Call f_name() with revised args (which also replaces f_name_to()).
authorWayne Davison <wayned@samba.org>
Sat, 14 Jan 2006 20:26:23 +0000 (20:26 +0000)
committerWayne Davison <wayned@samba.org>
Sat, 14 Jan 2006 20:26:23 +0000 (20:26 +0000)
generator.c
hlink.c
receiver.c
sender.c

index 82040c1..a4b9b0d 100644 (file)
@@ -281,7 +281,7 @@ static void delete_in_dir(struct file_list *flist, char *fbuf,
                        continue;
                if (flist_find(flist, fp) < 0) {
                        int mode = fp->mode;
-                       f_name_to(fp, delbuf);
+                       f_name(fp, delbuf);
                        delete_item(delbuf, mode, DEL_FORCE_RECURSE);
                }
        }
@@ -306,7 +306,7 @@ static void do_delete_pass(struct file_list *flist)
                if (!(file->flags & FLAG_DEL_HERE))
                        continue;
 
-               f_name_to(file, fbuf);
+               f_name(file, fbuf);
                if (verbose > 1 && file->flags & FLAG_TOP_DIR)
                        rprintf(FINFO, "deleting in %s\n", fbuf);
 
@@ -906,7 +906,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
                if (safe_symlinks && unsafe_symlink(file->u.link, fname)) {
                        if (verbose) {
                                if (the_file_list->count == 1)
-                                       fname = f_name(file);
+                                       fname = f_name(file, NULL);
                                rprintf(FINFO,
                                        "ignoring unsafe symlink %s -> \"%s\"\n",
                                        full_fname(fname), file->u.link);
@@ -1039,7 +1039,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
 
        if (!S_ISREG(file->mode)) {
                if (the_file_list->count == 1)
-                       fname = f_name(file);
+                       fname = f_name(file, NULL);
                rprintf(FINFO, "skipping non-regular file \"%s\"\n", fname);
                return;
        }
@@ -1047,7 +1047,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
        if (max_size && file->length > max_size) {
                if (verbose > 1) {
                        if (the_file_list->count == 1)
-                               fname = f_name(file);
+                               fname = f_name(file, NULL);
                        rprintf(FINFO, "%s is over max-size\n", fname);
                }
                return;
@@ -1055,7 +1055,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
        if (min_size && file->length < min_size) {
                if (verbose > 1) {
                        if (the_file_list->count == 1)
-                               fname = f_name(file);
+                               fname = f_name(file, NULL);
                        rprintf(FINFO, "%s is under min-size\n", fname);
                }
                return;
@@ -1111,7 +1111,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
                int j = find_fuzzy(file, fuzzy_dirlist);
                if (j >= 0) {
                        fuzzy_file = fuzzy_dirlist->files[j];
-                       f_name_to(fuzzy_file, fnamecmpbuf);
+                       f_name(fuzzy_file, fnamecmpbuf);
                        if (verbose > 2) {
                                rprintf(FINFO, "fuzzy basis selected for %s: %s\n",
                                        fname, fnamecmpbuf);
@@ -1333,7 +1333,7 @@ void generate_files(int f_out, struct file_list *flist, char *local_name)
                if (local_name)
                        strlcpy(fbuf, local_name, sizeof fbuf);
                else
-                       f_name_to(file, fbuf);
+                       f_name(file, fbuf);
                recv_generator(fbuf, file, i, itemizing, maybe_PERMS_REPORT,
                               code, f_out);
 
@@ -1387,7 +1387,7 @@ void generate_files(int f_out, struct file_list *flist, char *local_name)
                if (local_name)
                        strlcpy(fbuf, local_name, sizeof fbuf);
                else
-                       f_name_to(file, fbuf);
+                       f_name(file, fbuf);
                recv_generator(fbuf, file, i, itemizing, maybe_PERMS_REPORT,
                               code, f_out);
        }
@@ -1434,7 +1434,7 @@ void generate_files(int f_out, struct file_list *flist, char *local_name)
                                continue;
                        if (!need_retouch_dir_times && file->mode & S_IWUSR)
                                continue;
-                       recv_generator(f_name(file), file, i, itemizing,
+                       recv_generator(f_name(file, NULL), file, i, itemizing,
                                       maybe_PERMS_REPORT, code, -1);
                        if (allowed_lull && !(++j % lull_mod))
                                maybe_send_keepalive();
diff --git a/hlink.c b/hlink.c
index f4fa9fc..0f74950 100644 (file)
--- a/hlink.c
+++ b/hlink.c
@@ -181,11 +181,13 @@ int hard_link_check(struct file_struct *file, int ndx, char *fname,
                head = hlink_list[file->F_HLINDEX];
        if (ndx != head) {
                struct file_struct *head_file = FPTR(head);
-               if (!log_format_has_i && verbose > 1)
-                       rprintf(FINFO, "\"%s\" is a hard link\n", f_name(file));
+               if (!log_format_has_i && verbose > 1) {
+                       rprintf(FINFO, "\"%s\" is a hard link\n",
+                               f_name(file, NULL));
+               }
                if (head_file->F_HLINDEX == FINISHED_LINK) {
                        STRUCT_STAT st2, st3;
-                       char *toname = f_name(head_file);
+                       char *toname = f_name(head_file, NULL);
                        if (link_stat(toname, &st2, 0) < 0) {
                                rsyserr(FERROR, errno, "stat %s failed",
                                        full_fname(toname));
@@ -266,7 +268,7 @@ void hard_link_cluster(struct file_struct *file, int master, int itemizing,
        int statret, ndx = master;
 
        file->F_HLINDEX = FINISHED_LINK;
-       if (link_stat(f_name_to(file, hlink1), &st1, 0) < 0)
+       if (link_stat(f_name(file, hlink1), &st1, 0) < 0)
                return;
        if (!(file->flags & FLAG_HLINK_TOL)) {
                while (!(file->flags & FLAG_HLINK_EOL)) {
@@ -279,7 +281,7 @@ void hard_link_cluster(struct file_struct *file, int master, int itemizing,
                file = FPTR(ndx);
                if (file->F_HLINDEX != SKIPPED_LINK)
                        continue;
-               hlink2 = f_name(file);
+               hlink2 = f_name(file, NULL);
                statret = link_stat(hlink2, &st2, 0);
                maybe_hard_link(file, ndx, hlink2, statret, &st2,
                                hlink1, &st1, itemizing, code);
index db4f7f8..37c5074 100644 (file)
@@ -344,7 +344,7 @@ static void handle_delayed_updates(struct file_list *flist, char *local_name)
 
        for (i = -1; (i = next_delayed_bit(i)) >= 0; ) {
                struct file_struct *file = flist->files[i];
-               fname = local_name ? local_name : f_name(file);
+               fname = local_name ? local_name : f_name(file, NULL);
                if ((partialptr = partial_dir_fname(fname)) != NULL) {
                        if (make_backups && !make_backup(fname))
                                continue;
@@ -378,7 +378,7 @@ static int get_next_gen_i(int batch_gen_fd, int next_gen_i, int desired_i)
                        rprintf(FINFO,
                                "(No batched update for%s \"%s\")\n",
                                phase ? " resend of" : "",
-                               f_name(the_file_list->files[next_gen_i]));
+                               f_name(the_file_list->files[next_gen_i], NULL));
                }
                next_gen_i = read_int(batch_gen_fd);
                if (next_gen_i == -1)
@@ -456,7 +456,7 @@ int recv_files(int f_in, struct file_list *flist, char *local_name)
                        continue;
 
                file = flist->files[i];
-               fname = local_name ? local_name : f_name_to(file, fbuf);
+               fname = local_name ? local_name : f_name(file, fbuf);
 
                if (verbose > 2)
                        rprintf(FINFO, "recv_files(%s)\n", fname);
index c593d81..76546f1 100644 (file)
--- a/sender.c
+++ b/sender.c
@@ -133,7 +133,7 @@ void successful_send(int ndx)
                                    file->dir.root, "/", NULL);
        } else
                offset = 0;
-       f_name_to(file, fname + offset);
+       f_name(file, fname + offset);
        if (remove_sent_files && do_unlink(fname) == 0 && verbose > 1)
                rprintf(FINFO, "sender removed %s\n", fname + offset);
 }
@@ -254,7 +254,7 @@ void send_files(struct file_list *flist, int f_out, int f_in)
                                fname[offset++] = '/';
                } else
                        offset = 0;
-               fname2 = f_name_to(file, fname + offset);
+               fname2 = f_name(file, fname + offset);
 
                if (verbose > 2)
                        rprintf(FINFO, "send_files(%d, %s)\n", i, fname);