pulse-server: check if a runtime directory could be found

Print an error message and return an error code if all
options have been exhausted without success.
This commit is contained in:
Barnabás Pőcze 2021-07-25 01:54:51 +02:00
parent 30e3884a75
commit e90a70fd49

View file

@ -69,6 +69,11 @@ int get_runtime_dir(char *buf, size_t buflen, const char *dir)
runtime_dir = result ? result->pw_dir : NULL;
}
if (runtime_dir == NULL) {
pw_log_error(NAME": could not find a suitable runtime directory");
return -ENOENT;
}
size = snprintf(buf, buflen, "%s/%s", runtime_dir, dir);
if (size < 0)
return -errno;