[oe-commits] org.oe.dev makedevs: Add support for creating directories.
likewise commit
openembedded-commits at lists.openembedded.org
Mon Aug 20 18:08:21 UTC 2007
makedevs: Add support for creating directories.
Author: likewise at openembedded.org
Branch: org.openembedded.dev
Revision: b396aa55286b5d00bbc2fba14ef9dd30b82a3af9
ViewMTN: http://monotone.openembedded.org/revision.psp?id=b396aa55286b5d00bbc2fba14ef9dd30b82a3af9
Files:
1
packages/makedevs/makedevs-1.0.0/makedevs.c
Diffs:
#
# mt diff -ra7c945c7553419487f16c4537abf52baaa3d323c -rb396aa55286b5d00bbc2fba14ef9dd30b82a3af9
#
#
#
# patch "packages/makedevs/makedevs-1.0.0/makedevs.c"
# from [ea1e63451b180d14554bdb8508f0c4189e250d6b]
# to [d8baece6be2666c9a9d240fe16d7577ec42225c5]
#
============================================================
--- packages/makedevs/makedevs-1.0.0/makedevs.c ea1e63451b180d14554bdb8508f0c4189e250d6b
+++ packages/makedevs/makedevs-1.0.0/makedevs.c d8baece6be2666c9a9d240fe16d7577ec42225c5
@@ -106,6 +106,7 @@ static void add_new_directory(char *name
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_file(char *name, cha
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);
}
More information about the Openembedded-commits
mailing list