Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/makemandb avoid stdio assertion, failing later



details:   https://anonhg.NetBSD.org/src/rev/c75612c29470
branches:  trunk
changeset: 786835:c75612c29470
user:      christos <christos%NetBSD.org@localhost>
date:      Wed May 15 00:35:02 2013 +0000

description:
avoid stdio assertion, failing later

diffstat:

 usr.sbin/makemandb/makemandb.c |  12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diffs (33 lines):

diff -r 5511889ef7e1 -r c75612c29470 usr.sbin/makemandb/makemandb.c
--- a/usr.sbin/makemandb/makemandb.c    Tue May 14 15:33:21 2013 +0000
+++ b/usr.sbin/makemandb/makemandb.c    Wed May 15 00:35:02 2013 +0000
@@ -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.upadhyay%gmail.com@localhost>
  * Copyright (c) 2011 Kristaps Dzonsons <kristaps%bsd.lv@localhost>
@@ -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 @@
                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);



Home | Main Index | Thread Index | Old Index