From: Sascha Schumann Date: Mon, 15 May 2000 13:50:39 +0000 (+0000) Subject: Complain, if write(2) failed. X-Git-Tag: php-4.0.0~99 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6baa5bc2dc78192b621d12f4671fe70a039c6c92;p=php Complain, if write(2) failed. --- diff --git a/ext/session/mod_files.c b/ext/session/mod_files.c index 5b363a405b..27ca7fe937 100644 --- a/ext/session/mod_files.c +++ b/ext/session/mod_files.c @@ -260,7 +260,10 @@ PS_WRITE_FUNC(files) ftruncate(data->fd, 0); lseek(data->fd, 0, SEEK_SET); - write(data->fd, val, vallen); + if (write(data->fd, val, vallen) != vallen) { + php_error(E_WARNING, "write failed: %m (%d)", errno); + return FAILURE; + } return SUCCESS; }