diff --git a/sys/src/ape/cmd/pax/pass.c b/sys/src/ape/cmd/pax/pass.c index f43481dd7..608bd4d3d 100644 --- a/sys/src/ape/cmd/pax/pass.c +++ b/sys/src/ape/cmd/pax/pass.c @@ -153,7 +153,7 @@ char *dir; if ((ofd = openout(to, asb, islink(to, asb), 1)) < 0) { return (-1); } - if (ofd > 0) { + if (ofd >= 0) { passdata(from, ifd, to, ofd); } tstamp[0] = asb->sb_atime; diff --git a/sys/src/cmd/acme/xfid.c b/sys/src/cmd/acme/xfid.c index 32273d6f8..38db4acd0 100644 --- a/sys/src/cmd/acme/xfid.c +++ b/sys/src/cmd/acme/xfid.c @@ -129,7 +129,7 @@ xfidopen(Xfid *x) * though, we'd need to squirrel away the data in case it's * modified during the operation, e.g. by |sort */ - if(w->rdselfd > 0){ + if(w->rdselfd >= 0){ winunlock(w); respond(x, &fc, Einuse); return; diff --git a/sys/src/cmd/cpu.c b/sys/src/cmd/cpu.c index 56d1fd034..d38d71740 100644 --- a/sys/src/cmd/cpu.c +++ b/sys/src/cmd/cpu.c @@ -127,7 +127,7 @@ main(int argc, char **argv) origargs = procgetname(); /* see if we should use a larger message size */ fd = open("/dev/draw", OREAD); - if(fd > 0){ + if(fd >= 0){ ms = iounit(fd); if(msgsize < ms+IOHDRSZ) msgsize = ms+IOHDRSZ; diff --git a/sys/src/cmd/ip/ftpfs/file.c b/sys/src/cmd/ip/ftpfs/file.c index ff5bfeca0..5e113ed46 100644 --- a/sys/src/cmd/ip/ftpfs/file.c +++ b/sys/src/cmd/ip/ftpfs/file.c @@ -77,7 +77,7 @@ filefree(Node *node) if(fp == 0) return; - if(fp->fd > 0){ + if(fp->fd >= 0){ ntmp--; close(fp->fd); remove(fp->template); diff --git a/sys/src/cmd/ip/httpd/log.c b/sys/src/cmd/ip/httpd/log.c index ad97238e9..aee5c8da7 100644 --- a/sys/src/cmd/ip/httpd/log.c +++ b/sys/src/cmd/ip/httpd/log.c @@ -52,7 +52,7 @@ writelog(HConnect *c, char *fmt, ...) /* verbose logfile, for research on web traffic */ logfd = logall[today & 1]; - if(logfd > 0){ + if(logfd >= 0){ if(c->hstop == c->header || c->hstop[-1] != '\n') *c->hstop = '\n'; *c->hstop = '\0'; diff --git a/sys/src/cmd/ip/httpd/man2html.c b/sys/src/cmd/ip/httpd/man2html.c index 7971bf3bf..3d490d260 100644 --- a/sys/src/cmd/ip/httpd/man2html.c +++ b/sys/src/cmd/ip/httpd/man2html.c @@ -55,7 +55,7 @@ lookup(char *object, int section, Hit **list) snprint(file, sizeof(file), "/sys/man/%d/INDEX", section); fd = open(file, OREAD); - if(fd > 0){ + if(fd >= 0){ Binit(&b, fd, OREAD); for(;;){ p = Brdline(&b, '\n'); diff --git a/sys/src/cmd/ip/ppp/ppp.c b/sys/src/cmd/ip/ppp/ppp.c index 1225e8373..542d200e4 100644 --- a/sys/src/cmd/ip/ppp/ppp.c +++ b/sys/src/cmd/ip/ppp/ppp.c @@ -2758,7 +2758,7 @@ main(int argc, char **argv) snprint(buf, sizeof buf, "%sctl", dev); cfd = open(buf, ORDWR); } - if(cfd > 0){ + if(cfd >= 0){ if(baud) fprint(cfd, "b%d", baud); fprint(cfd, "m1"); /* cts/rts flow control (and fifo's) on */ diff --git a/sys/src/cmd/ndb/dnudpserver.c b/sys/src/cmd/ndb/dnudpserver.c index a94b2c740..5a4b4eee8 100644 --- a/sys/src/cmd/ndb/dnudpserver.c +++ b/sys/src/cmd/ndb/dnudpserver.c @@ -110,7 +110,7 @@ redistrib(uchar *buf, int len) uh = (Udphdr *)buf; for (tp = forwtarg; tp < forwtarg + forwtcount; tp++) - if (tp->fd > 0) { + if (tp->fd >= 0) { memmove(uh->raddr, tp->addr, sizeof tp->addr); hnputs(uh->rport, 53); /* dns port */ if (write(tp->fd, buf, len) != len) { diff --git a/sys/src/cmd/sam/sam.c b/sys/src/cmd/sam/sam.c index f53574d4f..d1b53c2ff 100644 --- a/sys/src/cmd/sam/sam.c +++ b/sys/src/cmd/sam/sam.c @@ -516,7 +516,7 @@ cd(String *str) if(chdir(s)) syserror("chdir"); fd = open("/dev/wdir", OWRITE); - if(fd > 0) + if(fd >= 0) write(fd, s, strlen(s)); dprint("!\n"); Strinit(&owd); diff --git a/sys/src/cmd/samterm/mesg.c b/sys/src/cmd/samterm/mesg.c index 99831a9e2..b5586ac55 100644 --- a/sys/src/cmd/samterm/mesg.c +++ b/sys/src/cmd/samterm/mesg.c @@ -670,7 +670,7 @@ hplumb(int nc) s = alloc(nc); for(i=0; i 0){ + if(plumbfd >= 0){ m = plumbunpack(s, nc); if(m != 0) plumbsend(plumbfd, m); diff --git a/sys/src/cmd/split.c b/sys/src/cmd/split.c index 9e46954c5..97a18addb 100644 --- a/sys/src/cmd/split.c +++ b/sys/src/cmd/split.c @@ -151,7 +151,7 @@ openf(void) Bflush(output); Bterm(output); - if(fd > 0) + if(fd >= 0) close(fd); fd = create(name,OWRITE,0666); if(fd < 0) { diff --git a/sys/src/cmd/upas/Mail/reply.c b/sys/src/cmd/upas/Mail/reply.c index 0a5edf46c..167a64bd5 100644 --- a/sys/src/cmd/upas/Mail/reply.c +++ b/sys/src/cmd/upas/Mail/reply.c @@ -336,7 +336,7 @@ print2(int fd, int ofd, char *fmt, ...) return -1; m = strlen(s); n = write(fd, s, m); - if(ofd > 0) + if(ofd >= 0) write(ofd, s, m); return n; } @@ -350,7 +350,7 @@ write2(int fd, int ofd, char *buf, int n, int nofrom) if(fd >= 0) m = write(fd, buf, n); - if(ofd <= 0) + if(ofd < 0) return m; if(nofrom == 0) @@ -463,7 +463,7 @@ mesgsend(Message *m) } ofd = open(outgoing, OWRITE|OCEXEC); /* no error check necessary */ - if(ofd > 0){ + if(ofd >= 0){ /* From dhog Fri Aug 24 22:13:00 EDT 2001 */ now = ctime(time(0)); fprint(ofd, "From %s %s", user, now); @@ -537,14 +537,14 @@ mesgsend(Message *m) write2(p[1], ofd, "\n", 1, 0); /* these look like pseudo-attachments in the "outgoing" box */ - if(ofd>0 && natt>0){ + if(ofd>=0 && natt>0){ for(i=0; i Include: %s\n", attlist[i]); else fprint(ofd, "=====> Attach: %s\n", attlist[i]); } - if(ofd > 0) + if(ofd >= 0) write(ofd, "\n", 1); for(i=0; i