PERFORCE change 123551 for review

Garrett Cooper gcooper at FreeBSD.org
Sun Jul 15 20:11:29 UTC 2007


http://perforce.freebsd.org/chv.cgi?CH=123551

Change 123551 by gcooper at optimus-revised_pkgtools on 2007/07/15 20:10:53

	Bad case to exit on. A return code of 0 from read(2) good, -1 is bad..

Affected files ...

.. //depot/projects/soc2007/revised_fbsd_pkgtools/usr/src/usr.sbin/pkg_install/lib/file.c#5 edit

Differences ...

==== //depot/projects/soc2007/revised_fbsd_pkgtools/usr/src/usr.sbin/pkg_install/lib/file.c#5 (text+ko) ====

@@ -223,7 +223,7 @@
 
     contents = (char *)malloc(sb.st_size + 1);
 
-    if (read(fileno(fd), contents, sb.st_size) == FAIL) {
+    if (read(fileno(fd), contents, sb.st_size) == -1) {
 	cleanup(0);
 	errx(2, "%s: short read on '%s' - did not get %lld bytes", __func__,
 	     fname, (long long)sb.st_size);


More information about the p4-projects mailing list