httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Roy T. Fielding" <field...@kiwi.ics.uci.edu>
Subject Re: [PATCH] Error logging in http_core.c: extra info, fseek()
Date Sun, 07 Mar 1999 09:13:27 GMT
> 		while (ap_each_byterange(r, &offset, &length)) {
>-		    fseek(f, offset, SEEK_SET);
>+		    if (fseek(f, offset, SEEK_SET))
>+			ap_log_error(APLOG_MARK, APLOG_ERR, r->server,
>+			    "Couldn't fseek(%d, %d): possible I/O failure",
>+			    f, offset);
> 		    ap_send_fd_length(f, r, length);
> 		}

I'm all for adding more error detection stuff, but the comparison should be

   if (fseek(f, offset, SEEK_SET) == -1)

since that is more reliable across platforms than a return of only zero
on success.  The same is true of other system calls (look at the man page
to see what is defined as "RETURN VALUES").

....Roy

Mime
View raw message