diff options
-rw-r--r-- | meta/recipes-devtools/makedevs/makedevs-1.0.0/makedevs.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/meta/recipes-devtools/makedevs/makedevs-1.0.0/makedevs.c b/meta/recipes-devtools/makedevs/makedevs-1.0.0/makedevs.c index 5d2c45b310..53700c687f 100644 --- a/meta/recipes-devtools/makedevs/makedevs-1.0.0/makedevs.c +++ b/meta/recipes-devtools/makedevs/makedevs-1.0.0/makedevs.c | |||
@@ -274,8 +274,20 @@ static void add_new_file(char *name, char *path, unsigned long uid, | |||
274 | static void add_new_fifo(char *name, char *path, unsigned long uid, | 274 | static void add_new_fifo(char *name, char *path, unsigned long uid, |
275 | unsigned long gid, unsigned long mode) | 275 | unsigned long gid, unsigned long mode) |
276 | { | 276 | { |
277 | if (mknod(path, mode, 0)) | 277 | int status; |
278 | error_msg_and_die("%s: file can not be created with mknod!", path); | 278 | struct stat sb; |
279 | |||
280 | memset(&sb, 0, sizeof(struct stat)); | ||
281 | status = stat(path, &sb); | ||
282 | |||
283 | |||
284 | /* Update the mode if we exist and are a fifo already */ | ||
285 | if (status >= 0 && S_ISFIFO(sb.st_mode)) { | ||
286 | chmod(path, mode); | ||
287 | } else { | ||
288 | if (mknod(path, mode, 0)) | ||
289 | error_msg_and_die("%s: file can not be created with mknod!", path); | ||
290 | } | ||
279 | chown(path, uid, gid); | 291 | chown(path, uid, gid); |
280 | // printf("File: %s %s UID: %ld GID: %ld MODE: %04lo\n", | 292 | // printf("File: %s %s UID: %ld GID: %ld MODE: %04lo\n", |
281 | // path, name, gid, uid, mode); | 293 | // path, name, gid, uid, mode); |