diff options
author | Erik Andersen | 1999-12-29 02:10:35 +0000 |
---|---|---|
committer | Erik Andersen | 1999-12-29 02:10:35 +0000 |
commit | 2fe08c7afb3ddef42f304e78cb6edfa28e0741ef (patch) | |
tree | 2c44125f9324373494668c513c31be2a172a54d4 /utility.c | |
parent | 00266d3df6ba8dcc6247f112372a0ce5a8ab2c32 (diff) | |
download | busybox-2fe08c7afb3ddef42f304e78cb6edfa28e0741ef.zip busybox-2fe08c7afb3ddef42f304e78cb6edfa28e0741ef.tar.gz |
Fixed cp so it works as God intended it to.
-Erik
Diffstat (limited to 'utility.c')
-rw-r--r-- | utility.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -151,7 +151,8 @@ copyFile( const char *srcName, const char *destName, if (S_ISDIR(srcStatBuf.st_mode)) { //fprintf(stderr, "copying directory %s to %s\n", srcName, destName); /* Make sure the directory is writable */ - if (mkdir(destName, 0777777 ^ umask(0))) { + result = mkdir(destName, 0777777 ^ umask(0)); + if (result < 0 && errno != EEXIST) { perror(destName); return (FALSE); } @@ -478,7 +479,7 @@ recursiveAction(const char *fileName, int recurse, int followLinks, int depthFir -#if defined (BB_TAR) || defined (BB_MKDIR) +#if defined (BB_TAR) || defined (BB_MKDIR) || defined (BB_CP) /* * Attempt to create the directories along the specified path, except for * the final component. The mode is given for the final directory only, |