]> code.ossystems Code Review - openembedded-core.git/commitdiff
makedevs: Add file and diretory creation code (from OE)
authorRichard Purdie <richard@openedhand.com>
Sat, 1 Sep 2007 23:47:58 +0000 (23:47 +0000)
committerRichard Purdie <richard@openedhand.com>
Sat, 1 Sep 2007 23:47:58 +0000 (23:47 +0000)
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@2642 311d38ba-8fff-0310-9ca6-ca027cbcb966

meta/packages/makedevs/makedevs-1.0.0/makedevs.c
meta/packages/makedevs/makedevs-native_1.0.0.bb
meta/packages/makedevs/makedevs_1.0.0.bb

index a9bf8e782a77ce3a6b049b93dca45efaec2b9f86..14569c61a26fdaec6a5220a51b45ab50bfc31888 100644 (file)
@@ -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);
 }
index 28544e12f235b5dfee3fcf9e2562e359882b7104..004a71374d826c33cd136fce6211f84e9a171ffc 100644 (file)
@@ -1,6 +1,6 @@
 SECTION = "base"
 require makedevs_${PV}.bb
-inherit native 
+inherit native
 
 FILESDIR = "${@os.path.dirname(bb.data.getVar('FILE',d,1))}/makedevs-${PV}"
 
index f6c1ffbfa15db62db6195a4b1e3e070a07d659e0..422d911089c5953ed34f827f04140a3c7723911f 100644 (file)
@@ -4,7 +4,7 @@ SECTION = "base"
 PRIORITY = "required"
 SRC_URI = "file://makedevs.c"
 S = "${WORKDIR}/makedevs-${PV}"
-PR = "r2"
+PR = "r3"
 
 do_configure() {
        install -m 0644 ${WORKDIR}/makedevs.c ${S}/