X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;ds=sidebyside;f=zpm-syncfs.c;h=6ea62415b7b9b84cffa58ca27d0a4d0bd29a8e85;hb=8d39ba5617367d688e653ab40192a9c7f9a5c187;hp=0a0f1d51d1343d6c636f5f8c8719bdcc61cde37a;hpb=6adc79aeafb90e90c9923b3eeedab662888927e9;p=zpackage diff --git a/zpm-syncfs.c b/zpm-syncfs.c index 0a0f1d5..6ea6241 100644 --- a/zpm-syncfs.c +++ b/zpm-syncfs.c @@ -234,16 +234,22 @@ static int remove_files(void *f, int ncols, char **vals, char **cols) { } if (S_ISDIR(st.st_mode)) { - fprintf(stderr, "rmdir %s\n", dest); + if (conf->verbose) { + fprintf(stderr, "rmdir(%s)\n", dest); + } rmdir(dest); } else if (S_ISREG(st.st_mode)) { /* TODO conf to import before removal */ if (conf->verbose) { fprintf(stderr, "unlink(%s)\n", dest); } - unlink(dest); + if (unlink(dest) == -1) { + IERR("can't unlink"); + } } else { - unlink(dest); + if (unlink(dest) == -1) { + IERR("can't unlink"); + } } return 0; @@ -377,7 +383,7 @@ static int install_files(void *f, int ncols, char **vals, char **cols) { } } - struct timespec times[2] = { 0 }; + struct timespec times[2] = { {0}, {0} }; double mtime = strtod(COL("mtime"),NULL); times[0].tv_nsec = UTIME_OMIT;