Commit fdb80e74 authored by Max Kellermann's avatar Max Kellermann

main: don't pass argv[0] to openDB()

Don't mention the program name in the error message.
parent 37bcd711
...@@ -89,7 +89,7 @@ struct notify main_notify; ...@@ -89,7 +89,7 @@ struct notify main_notify;
* process has been daemonized. * process has been daemonized.
*/ */
static bool static bool
openDB(Options * options, char *argv0) openDB(const Options *options)
{ {
const char *path = config_get_path(CONF_DB_FILE); const char *path = config_get_path(CONF_DB_FILE);
bool ret; bool ret;
...@@ -113,11 +113,9 @@ openDB(Options * options, char *argv0) ...@@ -113,11 +113,9 @@ openDB(Options * options, char *argv0)
ret = db_load(); ret = db_load();
if (!ret) { if (!ret) {
if (options->createDB < 0) { if (options->createDB < 0)
g_error("can't open db file and using " g_error("can't open db file and using "
"\"--no-create-db\" command line option; " "\"--no-create-db\" command line option");
"try running \"%s --create-db\"", argv0);
}
if (!db_check()) if (!db_check())
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
...@@ -250,7 +248,7 @@ int main(int argc, char *argv[]) ...@@ -250,7 +248,7 @@ int main(int argc, char *argv[])
decoder_plugin_init_all(); decoder_plugin_init_all();
update_global_init(); update_global_init();
create_db = !openDB(&options, argv[0]); create_db = !openDB(&options);
#ifdef ENABLE_SQLITE #ifdef ENABLE_SQLITE
sticker_global_init(config_get_path(CONF_STICKER_FILE)); sticker_global_init(config_get_path(CONF_STICKER_FILE));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment