]> granicus.if.org Git - vnstat/commitdiff
remove strerror(errno) information from secondary error prints when opening the datab...
authorTeemu Toivola <git@humdi.net>
Wed, 8 May 2019 20:19:59 +0000 (23:19 +0300)
committerTeemu Toivola <git@humdi.net>
Wed, 8 May 2019 20:19:59 +0000 (23:19 +0300)
src/vnstat.c
src/vnstatd.c
src/vnstati.c

index 8503eaa8791289e354a4b12d92abb30076f9fdf3..c8571aecf96548bf886bc4f59eef827978dec27b 100644 (file)
@@ -406,7 +406,7 @@ int main(int argc, char *argv[])
                        closedir(dir);
                        strncpy_nt(cfg.dbdir, p.dirname, 512);
                        if (!db_open_ro()) {
-                               printf("Error: Unable to open database \"%s/%s\": %s\n", p.dirname, DATABASEFILE, strerror(errno));
+                               printf("Error: Failed to open database \"%s/%s\" in read-only mode.\n", p.dirname, DATABASEFILE);
                                if (errno == ENOENT) {
                                        printf("The vnStat daemon should have created the database when started.\n");
                                        printf("Check that it is configured and running. See also \"man vnstatd\".\n");
index f23fd736f066ea35c2dba2bbc70ae6e5cbde3617..f7a0dcc401cc43ff6bf1c209440d423555bef495 100644 (file)
@@ -158,7 +158,7 @@ int main(int argc, char *argv[])
        setuser(s.user);
 
        if (!db_open_rw(1)) {
-               printf("Error: Unable to open database \"%s/%s\": %s\n", s.dirname, DATABASEFILE, strerror(errno));
+               printf("Error: Failed to open database \"%s/%s\" in read/write mode.\n", s.dirname, DATABASEFILE);
                printf("Exiting...\n");
                exit(EXIT_FAILURE);
        }
index 4d73352b0d88f8e37bc5494948490dc4179b692d..fe8335f6f3c31710ec0beb63fb75a357caa81b0b 100644 (file)
@@ -411,7 +411,7 @@ void handlecaching(IPARAMS *p, IMAGECONTENT *ic)
 void handledatabase(IPARAMS *p, IMAGECONTENT *ic)
 {
        if (!db_open_ro()) {
-               printf("Error: Unable to open database \"%s/%s\": %s\n", cfg.dbdir, DATABASEFILE, strerror(errno));
+               printf("Error: Failed to open database \"%s/%s\" in read-only mode.\n", cfg.dbdir, DATABASEFILE);
                exit(EXIT_FAILURE);
        }
        if (!db_getinterfacecountbyname(p->interface)) {