httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dirk.vanGulik" <Dirk.vanGu...@jrc.it>
Subject Re: HostAlias...
Date Mon, 01 Apr 1996 15:37:51 GMT

On the subject of write() and fwrite(), one catch
might be that the first one returns -1 on a fail whereas the
latter returns 0 I think, so a loop like

      while(n && !r->connection->aborted) {
            w=fwrite(&buf[o],sizeof(char),n,c->client);
            n-=w;
            o+=w;
            };

goes OK, but this goes bang

      while(n && !r->connection->aborted) {
            w=write(....; /* returns -1 on a fail ! */
            n-=w;
            o+=w;
	    };

I got caught by that recently.

Dw.

Mime
View raw message