directory = opendir(path);
if (!directory) {
- if (errno != ENOTDIR) {
+ switch (errno) {
+ case ENOTDIR:
ret = -LTTNG_ERR_LOAD_IO_FAIL;
goto end;
+ case ENOENT:
+ ret = -LTTNG_ERR_LOAD_SESSION_NOENT;
+ goto end;
+ default:
+ break;
}
}
if (directory) {