diff options
author | Richard Purdie <richard@openedhand.com> | 2007-09-01 23:47:58 +0000 |
---|---|---|
committer | Richard Purdie <richard@openedhand.com> | 2007-09-01 23:47:58 +0000 |
commit | 8d342dc0569fb4274b8ac9dfe40b1ce8543799f4 (patch) | |
tree | 41b4d38869b180f06bc75e818e0ea2bfb557f0b6 /meta/packages/makedevs/makedevs-1.0.0/makedevs.c | |
parent | bbbb9f5f08430bab30a284517a74e59c9a8ad477 (diff) | |
download | openembedded-core-8d342dc0569fb4274b8ac9dfe40b1ce8543799f4.tar.gz openembedded-core-8d342dc0569fb4274b8ac9dfe40b1ce8543799f4.tar.bz2 openembedded-core-8d342dc0569fb4274b8ac9dfe40b1ce8543799f4.zip |
makedevs: Add file and diretory creation code (from OE)
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@2642 311d38ba-8fff-0310-9ca6-ca027cbcb966
Diffstat (limited to 'meta/packages/makedevs/makedevs-1.0.0/makedevs.c')
-rw-r--r-- | meta/packages/makedevs/makedevs-1.0.0/makedevs.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/meta/packages/makedevs/makedevs-1.0.0/makedevs.c b/meta/packages/makedevs/makedevs-1.0.0/makedevs.c index a9bf8e782a..14569c61a2 100644 --- a/meta/packages/makedevs/makedevs-1.0.0/makedevs.c +++ b/meta/packages/makedevs/makedevs-1.0.0/makedevs.c @@ -106,6 +106,7 @@ static char *xstrdup(const char *s) static void add_new_directory(char *name, char *path, unsigned long uid, unsigned long gid, unsigned long mode) { + mkdir(path,mode); // printf("Directory: %s %s UID: %ld GID %ld MODE: %ld\n", path, name, uid, gid, mode); } @@ -136,6 +137,13 @@ static void add_new_device(char *name, char *path, unsigned long uid, static void add_new_file(char *name, char *path, unsigned long uid, unsigned long gid, unsigned long mode) { + int fd = open(path,O_CREAT | O_WRONLY, mode); + if(fd<0) + { + error_msg_and_die("%s: file can not be created!", path); + } else { + close(fd); + } // printf("File: %s %s UID: %ld GID: %ld MODE: %ld\n", // path, name, gid, uid, mode); } |