Compare commits
7 Commits
Author | SHA1 | Date | |
---|---|---|---|
0ca6ba656d | |||
3063272f1f | |||
1dad5cda13 | |||
a1e80eb09a | |||
b9f7caabe1 | |||
098d6d1c44 | |||
67906a920a |
9
Makefile
9
Makefile
@ -1,18 +1,19 @@
|
|||||||
# Install prefix
|
# Install destination and prefix
|
||||||
|
DESTDIR ?=
|
||||||
PREFIX ?= /usr/local
|
PREFIX ?= /usr/local
|
||||||
|
|
||||||
# Build flags
|
# Build flags
|
||||||
FLAGS = -std=gnu99
|
OPTS = -std=gnu99
|
||||||
|
|
||||||
# Build rules
|
# Build rules
|
||||||
all: backly
|
all: backly
|
||||||
.PHONY: all install clean
|
.PHONY: all install clean
|
||||||
|
|
||||||
backly: backly.c Makefile
|
backly: backly.c Makefile
|
||||||
gcc $(FLAGS) -o backly backly.c
|
gcc $(OPTS) $(CFLAGS) -o backly backly.c
|
||||||
|
|
||||||
install: backly
|
install: backly
|
||||||
install -m 0755 backly $(PREFIX)/bin
|
install -Dm 0755 backly $(DESTDIR)/$(PREFIX)/bin/backly
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f backly
|
rm -f backly
|
||||||
|
6
backly.c
6
backly.c
@ -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", "-fp", itemSrc, itemDest, (char *) NULL);
|
execlp("cp", "cp", "-f", "-P", "--preserve=timestamps,links", itemSrc, itemDest, (char *) NULL);
|
||||||
} else {
|
} else {
|
||||||
struct stat srcStat, destStat;
|
struct stat srcStat, destStat;
|
||||||
double pDone = 0;
|
double pDone = 0;
|
||||||
@ -285,6 +285,10 @@ void copyNew(char *src, int srcPrefix, char *dest, int destPrefix, int testMode)
|
|||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
for (int i = 0; i < numPrinted; i++)
|
||||||
|
printf("\b \b");
|
||||||
|
printf("100.00%%");
|
||||||
|
fflush(stdout);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
printf("\n");
|
printf("\n");
|
||||||
|
Reference in New Issue
Block a user