? ktrace.out Index: apropos-utils.c =================================================================== RCS file: /cvsroot/src/usr.sbin/makemandb/apropos-utils.c,v retrieving revision 1.2 diff -u -p -r1.2 apropos-utils.c --- apropos-utils.c 7 Feb 2012 19:17:16 -0000 1.2 +++ apropos-utils.c 14 Feb 2012 19:22:46 -0000 @@ -283,12 +283,12 @@ init_db(int db_flag) int create_db_flag = 0; /* Check if the database exists or not */ - if (!(stat(DBPATH, &sb) == 0 && S_ISREG(sb.st_mode))) { - /* Database does not exist, check if DB_CREATE was specified, and set - * flag to create the database schema + if (!(stat(DBPATH, &sb) == 0 && S_ISREG(sb.st_mode) && sb.st_size > 0)) { + /* Database does not exist or is empty, check if DB_CREATE was + * specified, and set flag to create the database schema */ if (db_flag != (MANDB_CREATE)) { - warnx("Missing apropos database. " + warnx("Missing or empty apropos database. " "Please run makemandb to create it."); return NULL; } Index: makemandb.c =================================================================== RCS file: /cvsroot/src/usr.sbin/makemandb/makemandb.c,v retrieving revision 1.2 diff -u -p -r1.2 makemandb.c --- makemandb.c 7 Feb 2012 19:17:16 -0000 1.2 +++ makemandb.c 14 Feb 2012 19:22:47 -0000 @@ -306,7 +306,7 @@ main(int argc, char *argv[]) manconf = optarg; break; case 'f': - remove(DBPATH); + truncate(DBPATH, 0); mflags.recreate = 1; break; case 'l':