summaryrefslogtreecommitdiffstats
path: root/usr.bin/doscmd/AsyncIO.c
diff options
context:
space:
mode:
authortg <tg@FreeBSD.org>2001-07-24 11:50:23 +0000
committertg <tg@FreeBSD.org>2001-07-24 11:50:23 +0000
commit47c2c99b5115c72bc1c4ad5ba8e7d21169d982ae (patch)
treef69b902c12889e39d57e3d83d55293ee0abee74b /usr.bin/doscmd/AsyncIO.c
parent97507091ff20d3dc72113dfbd0c9532423d3acb4 (diff)
downloadFreeBSD-src-47c2c99b5115c72bc1c4ad5ba8e7d21169d982ae.zip
FreeBSD-src-47c2c99b5115c72bc1c4ad5ba8e7d21169d982ae.tar.gz
Clean up the code a bit:
- add $FreeBSD$; - remove unused variables; - add missing headers and prototypes; - -Wshadow.
Diffstat (limited to 'usr.bin/doscmd/AsyncIO.c')
-rw-r--r--usr.bin/doscmd/AsyncIO.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/usr.bin/doscmd/AsyncIO.c b/usr.bin/doscmd/AsyncIO.c
index 992fee5..021b525 100644
--- a/usr.bin/doscmd/AsyncIO.c
+++ b/usr.bin/doscmd/AsyncIO.c
@@ -32,15 +32,18 @@
* $FreeBSD$
*/
-#include <stdio.h>
#include <sys/param.h>
#include <sys/types.h>
-#include <fcntl.h>
#include <sys/time.h>
-#include <signal.h>
#include <errno.h>
+#include <fcntl.h>
#include <limits.h>
+#include <signal.h>
+#include <stdio.h>
+#include <unistd.h>
+
#include "doscmd.h"
+#include "AsyncIO.h"
#define FD_ISZERO(p) ((p)->fds_bits[0] == 0)
@@ -55,11 +58,11 @@
* Request that ``func'' be called everytime data is available on ``fd''
*/
-static fd_set fdset = { 0 }; /* File Descriptors to select on */
+static fd_set fdset; /* File Descriptors to select on */
typedef struct {
void (*func)(void *, REGISTERS);
- /* Function to call when data arrives */
+ /* Function to call on data arrival */
void (*failure)(void *); /* Function to call on failure */
void *arg; /* Argument to above functions */
int lockcnt; /* Nested level of lock */
@@ -99,13 +102,11 @@ printf("%d: Invalid FD\n", fd);
}
if (firsttime) {
- struct sigaction sa;
-
firsttime = 0;
setsignal(SIGIO, HandleIO);
}
- if (handlers[fd].func = func) {
+ if ((handlers[fd].func = func) != 0) {
as->lockcnt = 0;
as->arg = arg;
as->failure = failure;
OpenPOWER on IntegriCloud