diff options
Diffstat (limited to 'cmd/service/dumpscript.c')
-rw-r--r-- | cmd/service/dumpscript.c | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/cmd/service/dumpscript.c b/cmd/service/dumpscript.c index 1822aa9..7102b5c 100644 --- a/cmd/service/dumpscript.c +++ b/cmd/service/dumpscript.c @@ -10,9 +10,8 @@ static service_t *try_load(const char *directory, const char *filename) { - int dirfd, type; - struct stat sb; service_t *svc; + int dirfd; dirfd = open(directory, O_RDONLY | O_DIRECTORY); @@ -21,18 +20,6 @@ static service_t *try_load(const char *directory, const char *filename) return NULL; } - if (fstatat(dirfd, filename, &sb, AT_SYMLINK_NOFOLLOW)) { - fprintf(stderr, "stat %s/%s: %s\n", - directory, filename, strerror(errno)); - close(dirfd); - return NULL; - } - - type = (sb.st_mode & S_IFMT); - - if (type != S_IFREG && type != S_IFLNK) - return NULL; - svc = rdsvc(dirfd, filename, 0); close(dirfd); return svc; |