Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 15 Jul 2007 20:11:28 GMT
From:      Garrett Cooper <gcooper@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 123551 for review
Message-ID:  <200707152011.l6FKBSOJ028661@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=123551

Change 123551 by gcooper@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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200707152011.l6FKBSOJ028661>