Firewall Wizards mailing list archives

Re: Code reviews [Was: FWTK and smap/smapd]


From: Joseph S D Yao <jsdy () center osis gov>
Date: Tue, 23 Jul 2002 11:55:55 -0400

Oh, geez, shouldn't everyone have written [something like] this?

register char *cp = buf;
register int i, count = n;

for (;;) {
        i = write(fd, cp, count);
        if (i < 0) {
                perror("...");
                fprintf(stderr, ...);
                break;
        }
        count -= i;
        if (count <= 0) /* yes, should never be <, optionally fuss */
                break;
        cp += i;
        if (i == 0 {
                sleep(1);
                /* should probably count and break if too many */
        }
}

-- 
Joe Yao                         jsdy () center osis gov - Joseph S. D. Yao
OSIS Center Systems Support                                     EMT-B
-----------------------------------------------------------------------
   This message is not an official statement of OSIS Center policies.
_______________________________________________
firewall-wizards mailing list
firewall-wizards () honor icsalabs com
http://honor.icsalabs.com/mailman/listinfo/firewall-wizards


Current thread: