Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 16 Jul 2007 03:03:25 GMT
From:      Garrett Cooper <gcooper@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 123578 for review
Message-ID:  <200707160303.l6G33PoX000247@repoman.freebsd.org>

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

Change 123578 by gcooper@optimus-revised_pkgtools on 2007/07/16 03:02:24

	2 mistakes.
		-Make sure that fd isn't NULL, instead of NULL.
		-It's not O_RDONLY, it's "r" for fopen. Funny why gcc didn't pick up that error...

Affected files ...

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

Differences ...

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

@@ -195,9 +195,9 @@
 {
     char *contents;
 
-    FILE *fd = fopen(fname, O_RDONLY);
+    FILE *fd = fopen(fname, "r");
 
-    if (fd != NULL) {
+    if (fd == NULL) {
 	cleanup(0);
 	errx(2, "%s: unable to open '%s' for reading", __func__, fname);
     }



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