PERFORCE change 123550 for review

Garrett Cooper gcooper at FreeBSD.org
Sun Jul 15 20:08:24 UTC 2007


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

Change 123550 by gcooper at optimus-revised_pkgtools on 2007/07/15 20:07:45

	Quite simply, works with read, but not fread. Or maybe it's just me :)?

Affected files ...

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

Differences ...

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

@@ -223,7 +223,7 @@
 
     contents = (char *)malloc(sb.st_size + 1);
 
-    if ((int) fread(contents, sb.st_size, 1, fd) == FAIL) {
+    if (read(fileno(fd), contents, sb.st_size) == FAIL) {
 	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