Module Name:    src
Committed By:   christos
Date:           Mon Mar 31 00:00:22 UTC 2014

Modified Files:
        src/usr.sbin/mtree: getid.c

Log Message:
say why we can't use the password or the group databases.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/usr.sbin/mtree/getid.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/mtree/getid.c
diff -u src/usr.sbin/mtree/getid.c:1.8 src/usr.sbin/mtree/getid.c:1.9
--- src/usr.sbin/mtree/getid.c:1.8	Wed Oct 16 13:27:42 2013
+++ src/usr.sbin/mtree/getid.c	Sun Mar 30 20:00:22 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: getid.c,v 1.8 2013/10/16 17:27:42 christos Exp $	*/
+/*	$NetBSD: getid.c,v 1.9 2014/03/31 00:00:22 christos Exp $	*/
 /*	from: NetBSD: getpwent.c,v 1.48 2000/10/03 03:22:26 enami Exp */
 /*	from: NetBSD: getgrent.c,v 1.41 2002/01/12 23:51:30 lukem Exp */
 
@@ -65,7 +65,7 @@
 #endif
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: getid.c,v 1.8 2013/10/16 17:27:42 christos Exp $");
+__RCSID("$NetBSD: getid.c,v 1.9 2014/03/31 00:00:22 christos Exp $");
 
 #include <sys/param.h>
 
@@ -206,7 +206,12 @@ grstart(void)
 	}
 	if (grfile[0] == '\0')			/* sanity check */
 		return 0;
-	return (_gr_fp = fopen(grfile, "r")) ? 1 : 0;
+
+	_gr_fp = fopen(grfile, "r");
+	if (_gr_fp != NULL)
+		return 1;
+	warn("Can't open `%s'", grfile);
+	return 0;
 }
 
 
@@ -350,7 +355,11 @@ pwstart(void)
 	}
 	if (pwfile[0] == '\0')			/* sanity check */
 		return 0;
-	return (_pw_fp = fopen(pwfile, "r")) ? 1 : 0;
+	_pw_fp = fopen(pwfile, "r");
+	if (_pw_fp != NULL)
+		return 1;
+	warn("Can't open `%s'", pwfile);
+	return 0;
 }
 
 

Reply via email to