Author: tridge Date: 2005-08-18 12:19:16 +0000 (Thu, 18 Aug 2005) New Revision: 9389
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=9389 Log: handle errors reading from files in web server bug found by coverity Modified: branches/SAMBA_4_0/source/web_server/web_server.c Changeset: Modified: branches/SAMBA_4_0/source/web_server/web_server.c =================================================================== --- branches/SAMBA_4_0/source/web_server/web_server.c 2005-08-18 11:16:32 UTC (rev 9388) +++ branches/SAMBA_4_0/source/web_server/web_server.c 2005-08-18 12:19:16 UTC (rev 9389) @@ -153,13 +153,14 @@ web->output.nsent = 0; nread = read(web->output.fd, buf, sizeof(buf)); - if (nread == 0) { + if (nread == -1 && errno == EINTR) { + return; + } + if (nread <= 0) { close(web->output.fd); web->output.fd = -1; + nread = 0; } - if (nread == -1 && errno == EINTR) { - return; - } web->output.content = data_blob_talloc(web, buf, nread); }