mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-01-11 05:17:44 +03:00
install: use null_or_empty_path()
This commit is contained in:
parent
4e54a17dbb
commit
0efaa4843e
@ -1335,8 +1335,8 @@ static int unit_file_load_or_readlink(
|
|||||||
const char *path,
|
const char *path,
|
||||||
const char *root_dir,
|
const char *root_dir,
|
||||||
SearchFlags flags) {
|
SearchFlags flags) {
|
||||||
|
|
||||||
_cleanup_free_ char *resolved = NULL;
|
_cleanup_free_ char *resolved = NULL;
|
||||||
struct stat st;
|
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
r = unit_file_load(c, info, path, root_dir, flags);
|
r = unit_file_load(c, info, path, root_dir, flags);
|
||||||
@ -1351,9 +1351,7 @@ static int unit_file_load_or_readlink(
|
|||||||
* so let's see if the path is a (possibly dangling) symlink to /dev/null. */
|
* so let's see if the path is a (possibly dangling) symlink to /dev/null. */
|
||||||
info->type = UNIT_FILE_TYPE_MASKED;
|
info->type = UNIT_FILE_TYPE_MASKED;
|
||||||
|
|
||||||
else if (r > 0 &&
|
else if (r > 0 && null_or_empty_path(resolved) > 0)
|
||||||
stat(resolved, &st) >= 0 &&
|
|
||||||
null_or_empty(&st))
|
|
||||||
|
|
||||||
info->type = UNIT_FILE_TYPE_MASKED;
|
info->type = UNIT_FILE_TYPE_MASKED;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user