omit perror when enumerating devices on first run

the directory will later be created automatically; don't worry users :)

  addresses #481
This commit is contained in:
Jan-Piet Mens
2024-07-28 12:10:53 +02:00
parent 3634f46496
commit 394e5b8825
+3 -2
View File
@@ -141,7 +141,8 @@ static int user_device_list(char *name, int level, JsonNode *obj)
struct stat sb;
if ((dirp = opendir(name)) == NULL) {
perror(name);
// Hide error; the directory will be created automatically later
// perror(name);
return (1);
}
while ((dp = readdir(dirp)) != NULL) {
@@ -1266,7 +1267,7 @@ JsonNode *kill_datastore(char *user, char *device)
olog(LOG_NOTICE, "removed %s", p);
json_append_element(killed, json_mkstring(namelist[i]->d_name));
} else {
perror(p);
olog(LOG_NOTICE, "kill_datastore: %s: %m", p);
}
free(namelist[i]);