Module Name:    src
Committed By:   christos
Date:           Wed May 15 00:35:02 UTC 2013

Modified Files:
        src/usr.sbin/makemandb: makemandb.c

Log Message:
avoid stdio assertion, failing later


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/usr.sbin/makemandb/makemandb.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/makemandb/makemandb.c
diff -u src/usr.sbin/makemandb/makemandb.c:1.18 src/usr.sbin/makemandb/makemandb.c:1.19
--- src/usr.sbin/makemandb/makemandb.c:1.18	Sun Feb 10 18:24:18 2013
+++ src/usr.sbin/makemandb/makemandb.c	Tue May 14 20:35:02 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: makemandb.c,v 1.18 2013/02/10 23:24:18 christos Exp $	*/
+/*	$NetBSD: makemandb.c,v 1.19 2013/05/15 00:35:02 christos Exp $	*/
 /*
  * Copyright (c) 2011 Abhinav Upadhyay <er.abhinav.upadh...@gmail.com>
  * Copyright (c) 2011 Kristaps Dzonsons <krist...@bsd.lv>
@@ -17,7 +17,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: makemandb.c,v 1.18 2013/02/10 23:24:18 christos Exp $");
+__RCSID("$NetBSD: makemandb.c,v 1.19 2013/05/15 00:35:02 christos Exp $");
 
 #include <sys/stat.h>
 #include <sys/types.h>
@@ -349,8 +349,12 @@ main(int argc, char *argv[])
 		manconf = MANCONF;
 	}
 
-	if (mflags.recreate)
-		remove(get_dbpath(manconf));
+	if (mflags.recreate) {
+		char *dbp = get_dbpath(manconf);
+		/* No error here, it will fail in init_db in the same call */
+		if (dbp != NULL)
+			remove(dbp);
+	}
 
 	if ((db = init_db(MANDB_CREATE, manconf)) == NULL)
 		exit(EXIT_FAILURE);

Reply via email to