tech-userlevel archive

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

/var/db/locate.database is empty



On first install may have to wait a week.

t1:locate$ ./locate kjhfkjdhk 
Database `/var/db/locate.database` is empty. See locate.updatedb(8) manual.

--- locate.c    12 Apr 2009 13:53:02 -0000      1.17
+++ locate.c    18 May 2012 14:29:36 -0000
@@ -124,6 +124,11 @@
                errno = EISDIR;
                err(1, "Can't use database `%s'", path);
        }
+       if (st.st_size == 0) {
+               (void)fprintf(stderr, "Database `%s` is empty. "
+                        "See locate.updatedb(8) manual.\n", path);
+               exit(1);
+       }
        dbp = NEW(struct locate_db);
        dbp->db_fp = fp;
        dbp->db_path = path;


Okay to exit with error?


Home | Main Index | Thread Index | Old Index