- if (notmuch_config_is_new (config))
- return notmuch_setup_command (config, notmuch, 0, NULL);
+ config_path = notmuch_config_path (notmuch);
+ if (access (config_path, R_OK | F_OK) == -1) {
+ if (errno != ENOENT) {
+ fprintf (stderr, "Error: %s config file access failed: %s\n", config_path,
+ strerror (errno));
+ return EXIT_FAILURE;
+ } else {
+ return notmuch_setup_command (NULL, notmuch, 0, NULL);
+ }
+ }