Bug fix with execlp()

This commit is contained in:
L. Bradley LaBoon 2015-03-13 09:36:36 -04:00
parent 098d6d1c44
commit b9f7caabe1

View File

@ -259,7 +259,7 @@ void copyNew(char *src, int srcPrefix, char *dest, int destPrefix, int testMode)
// Only copy file if it doesn't exist or has changed // Only copy file if it doesn't exist or has changed
if (needToCopy == 1) { if (needToCopy == 1) {
printf("+ %s 100.00%", itemSrc + srcPrefix); printf("+ %s 100.00%%", itemSrc + srcPrefix);
fflush(stdout); fflush(stdout);
if (testMode == 0) { if (testMode == 0) {
int pid = fork(); int pid = fork();
@ -267,7 +267,7 @@ void copyNew(char *src, int srcPrefix, char *dest, int destPrefix, int testMode)
fprintf(stderr, "Could not fork: %s\n", strerror(errno)); fprintf(stderr, "Could not fork: %s\n", strerror(errno));
continue; continue;
} else if (pid == 0) { } else if (pid == 0) {
execlp("cp", "cp", "-f --preserve=timestamps", itemSrc, itemDest, (char *) NULL); execlp("cp", "cp", "-f", "--preserve=timestamps", itemSrc, itemDest, (char *) NULL);
} else { } else {
struct stat srcStat, destStat; struct stat srcStat, destStat;
double pDone = 0; double pDone = 0;