add error check to getcwd

This commit is contained in:
Jethro Grassie 2019-04-07 14:01:16 -04:00
parent 515ba33902
commit 83dace40c1
No known key found for this signature in database
GPG key ID: DE8ED755616565BB

View file

@ -2196,7 +2196,11 @@ read_config(const char *config_file, const char *log_file)
}
else
{
getcwd(path, MAX_PATH);
if (!getcwd(path, MAX_PATH))
{
log_fatal("Cannot getcwd (%s). Aborting.", errno);
abort();
}
strcat(path, "/pool.conf");
if (access(path, R_OK) != 0)
{