]> pd.if.org Git - zpackage/blobdiff - zpm-syncfs.c
fix installing of symlinks
[zpackage] / zpm-syncfs.c
index 073ad0b291188dfd92b2013ac69fe46b412dea67..958fde80535b90e611366dbe8c6ab89c4c64ad5c 100644 (file)
@@ -367,10 +367,11 @@ static int install_files(void *f, int ncols, char **vals, char **cols) {
                        IERR("zero length symlink not allowed");
                }
 
-               if (conf->verbose > 1) {
-                       fprintf(stderr, "symlink %s -> %s\n", path, target);
+               if (conf->verbose > 0) {
+                       fprintf(stderr, "symlink %s -> %s\n", dest, target);
                }
-               if (symlink(target, path) == -1) {
+               if (symlink(target, dest) == -1) {
+                       perror("symlink failed");
                        IERR("can't symlink");
                }
        } else {
@@ -383,7 +384,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;