Fixed Source URL and changed from ftp to http.
[rsync/rsync.git] / util.c
diff --git a/util.c b/util.c
index e236ca5..05748b1 100644 (file)
--- a/util.c
+++ b/util.c
@@ -147,8 +147,9 @@ int set_modtime(const char *fname, time_t modtime, mode_t mode)
                t[1].tv_usec = 0;
 # ifdef HAVE_LUTIMES
                if (S_ISLNK(mode)) {
-                       lutimes(fname, t);
-                       return 0; /* ignore errors */
+                       if (lutimes(fname, t) < 0 && errno != ENOSYS)
+                               return -1;
+                       return 0;
                }
 # endif
                return utimes(fname, t);
@@ -274,20 +275,20 @@ int copy_file(const char *source, const char *dest, int ofd,
        int len;   /* Number of bytes read into `buf'. */
 
        if ((ifd = do_open(source, O_RDONLY, 0)) < 0) {
-               rsyserr(FERROR, errno, "open %s", full_fname(source));
+               rsyserr(FERROR_XFER, errno, "open %s", full_fname(source));
                return -1;
        }
 
        if (ofd < 0) {
                if (robust_unlink(dest) && errno != ENOENT) {
-                       rsyserr(FERROR, errno, "unlink %s", full_fname(dest));
+                       rsyserr(FERROR_XFER, errno, "unlink %s", full_fname(dest));
                        return -1;
                }
 
                if ((ofd = do_open(dest, O_WRONLY | O_CREAT | O_TRUNC | O_EXCL, mode)) < 0
                 && (!create_bak_dir || errno != ENOENT || make_bak_dir(dest) < 0
                  || (ofd = do_open(dest, O_WRONLY | O_CREAT | O_TRUNC | O_EXCL, mode)) < 0)) {
-                       rsyserr(FERROR, errno, "open %s", full_fname(dest));
+                       rsyserr(FERROR_XFER, errno, "open %s", full_fname(dest));
                        close(ifd);
                        return -1;
                }
@@ -295,7 +296,7 @@ int copy_file(const char *source, const char *dest, int ofd,
 
        while ((len = safe_read(ifd, buf, sizeof buf)) > 0) {
                if (full_write(ofd, buf, len) < 0) {
-                       rsyserr(FERROR, errno, "write %s", full_fname(dest));
+                       rsyserr(FERROR_XFER, errno, "write %s", full_fname(dest));
                        close(ifd);
                        close(ofd);
                        return -1;
@@ -303,19 +304,19 @@ int copy_file(const char *source, const char *dest, int ofd,
        }
 
        if (len < 0) {
-               rsyserr(FERROR, errno, "read %s", full_fname(source));
+               rsyserr(FERROR_XFER, errno, "read %s", full_fname(source));
                close(ifd);
                close(ofd);
                return -1;
        }
 
        if (close(ifd) < 0) {
-               rsyserr(FINFO, errno, "close failed on %s",
+               rsyserr(FWARNING, errno, "close failed on %s",
                        full_fname(source));
        }
 
        if (close(ofd) < 0) {
-               rsyserr(FERROR, errno, "close failed on %s",
+               rsyserr(FERROR_XFER, errno, "close failed on %s",
                        full_fname(dest));
                return -1;
        }
@@ -371,7 +372,7 @@ int robust_unlink(const char *fname)
        } while ((rc = access(path, 0)) == 0 && counter != start);
 
        if (verbose > 0) {
-               rprintf(FINFO,"renaming %s to %s because of text busy\n",
+               rprintf(FWARNING, "renaming %s to %s because of text busy\n",
                        fname, path);
        }
 
@@ -898,6 +899,9 @@ int push_dir(const char *dir, int set_path_only)
                curr_dir_depth = count_dir_elements(curr_dir + module_dirlen);
        }
 
+       if (verbose >= 5)
+               rprintf(FINFO, "[%s] dir is now %s\n", who_am_i(), curr_dir);
+
        return 1;
 }