From: Sascha Schumann Date: Fri, 22 Dec 2000 19:26:02 +0000 (+0000) Subject: Signal an error condition, if write was unable to perform the complete X-Git-Tag: php-4.0.5RC1~813 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9815d5c94cda204400b24147d8117409853535e0;p=php Signal an error condition, if write was unable to perform the complete operation. --- diff --git a/ext/standard/file.c b/ext/standard/file.c index 278282d721..6eab2d14db 100644 --- a/ext/standard/file.c +++ b/ext/standard/file.c @@ -1688,8 +1688,8 @@ PHPAPI int php_copy_file(char *src, char *dest) } srcfile = mmap(NULL, sbuf.st_size, PROT_READ, MAP_SHARED, fd_s, 0); if (srcfile != (void *) MAP_FAILED) { - write(fd_t, srcfile, sbuf.st_size); - ret = SUCCESS; + if (write(fd_t, srcfile, sbuf.st_size) == sbuf.st_size) + ret = SUCCESS; munmap(srcfile, sbuf.st_size); goto cleanup; }