5 Commits
v1.0 ... v1.13

2 changed files with 10 additions and 5 deletions

View File

@ -1,18 +1,19 @@
# Install prefix
# Install destination and prefix
DESTDIR ?=
PREFIX ?= /usr/local
# Build flags
FLAGS = -std=gnu99
OPTS = -std=gnu99
# Build rules
all: backly
.PHONY: all install clean
backly: backly.c Makefile
gcc $(FLAGS) -o backly backly.c
gcc $(OPTS) $(CFLAGS) -o backly backly.c
install: backly
install -m 0755 backly $(PREFIX)/bin
install -Dm 0755 backly $(DESTDIR)/$(PREFIX)/bin/backly
clean:
rm -f backly

View File

@ -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));
continue;
} else if (pid == 0) {
execlp("cp", "cp", "-fp", itemSrc, itemDest, (char *) NULL);
execlp("cp", "cp", "-f", "--preserve=timestamps", itemSrc, itemDest, (char *) NULL);
} else {
struct stat srcStat, destStat;
double pDone = 0;
@ -285,6 +285,10 @@ void copyNew(char *src, int srcPrefix, char *dest, int destPrefix, int testMode)
fflush(stdout);
}
}
for (int i = 0; i < numPrinted; i++)
printf("\b \b");
printf("100.00%%");
fflush(stdout);
}
}
printf("\n");