mirror of
https://github.com/troglobit/finit.git
synced 2026-11-29 21:08:21 +00:00
Replace libite:fmode() with stat(), removed in libite v2
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
1 parent
5406af2054
commit
cd73c1c951
1 file changed
+7
-3
+7
-3
@@ -430,14 +430,18 @@ int run_parts(char *dir, char *cmd)
|
|||||||
for (i = 0; i < num; i++) {
|
for (i = 0; i < num; i++) {
|
||||||
int j = 0;
|
int j = 0;
|
||||||
pid_t pid = 0;
|
pid_t pid = 0;
|
||||||
mode_t mode;
|
struct stat st;
|
||||||
char *args[NUM_ARGS];
|
char *args[NUM_ARGS];
|
||||||
char *name = e[i]->d_name;
|
char *name = e[i]->d_name;
|
||||||
char path[LINE_SIZE];
|
char path[LINE_SIZE];
|
||||||
|
|
||||||
snprintf(path, sizeof(path), "%s/%s", dir, name);
|
snprintf(path, sizeof(path), "%s/%s", dir, name);
|
||||||
mode = fmode(path);
|
if (stat(path, &st)) {
|
||||||
if (!S_ISEXEC(mode) || S_ISDIR(mode)) {
|
_d("Failed stat(%s): %s", path, strerror(errno));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!S_ISEXEC(st.st_mode) || S_ISDIR(st.st_mode)) {
|
||||||
_d("Skipping %s ...", path);
|
_d("Skipping %s ...", path);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user