diff options
Diffstat (limited to 'src/shared/util.c')
-rw-r--r-- | src/shared/util.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/shared/util.c b/src/shared/util.c index 3d16cd1a13..0db4bd90e8 100644 --- a/src/shared/util.c +++ b/src/shared/util.c @@ -6918,3 +6918,15 @@ int take_password_lock(const char *root) { return fd; } + +int is_symlink(const char *path) { + struct stat info; + + if (lstat(path, &info) < 0) + return -errno; + + if (S_ISLNK(info.st_mode)) + return 1; + + return 0; +}
\ No newline at end of file |