*** empty log message ***

This commit is contained in:
Ben Gras 2005-08-11 16:18:53 +00:00
parent 4e4b661941
commit 64695715da
2 changed files with 15 additions and 7 deletions

View file

@ -364,7 +364,7 @@ int trylink(const char *src, const char *dst, struct stat *srcst,
if (dstst->st_ino != 0) (void) unlink(dst);
if ((linked= (link(olddst, dst) == 0)) && vflag)
printf("ln %s %s\n", olddst, dst);
printf("ln %s ..\n", olddst);
return linked;
}
@ -728,7 +728,7 @@ void link1(const char *src, const char *dst, struct stat *srcst,
/* Can't do a cross-device link, we have to symlink. */
xdev= 1;
} else {
if (vflag) printf("ln %s %s\n", src, dst);
if (vflag) printf("ln %s..\n", src);
return;
}
}

View file

@ -2,6 +2,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <unistd.h>
_PROTOTYPE(int main, (int argc, char **argv));
@ -10,18 +11,24 @@ prettyprogress(long b, long maxb, time_t starttime)
{
/* print progress indication */
time_t spent, now;
long bpsec;
double bpsec;
time(&now);
spent = now - starttime;
if(spent > 0 && (bpsec = b / spent) > 0) {
if(spent > 0 && (bpsec = (double)b / spent) > 0) {
int len, i;
long secremain, minremain, hremain;
secremain = (maxb - b) / bpsec;
minremain = (secremain / 60) % 60;
hremain = secremain / 3600;
len = fprintf(stderr, "Remain %ld files. ETA: %d:%02d:%02d [",
maxb - b,
len = fprintf(stderr, "Remain %ld files. ", maxb-b);
#if 0
len += fprintf(stderr, "ETA: %d:%02d:%02d ",
hremain, minremain, secremain % 60);
#endif
len += fprintf(stderr, " [");
#define WIDTH 77
len = WIDTH - len;
for(i = 0; i < (b * (len-1) / maxb); i++)
@ -46,6 +53,7 @@ char *argv[];
if(argc < 2) return 1;
count = atol(argv[1]);
if(count < 1) return 1;
sync();
time(&start);
printf("\n");
while(fgets(line, sizeof(line), stdin)) {
@ -54,7 +62,7 @@ char *argv[];
if(i <= count) prettyprogress(i, count, start);
else printf("\r");
printf("");
fflush(NULL);
fflush(stdout);
}
fprintf(stderr, "\nDone.\n");