Use the new f_name_to() calling syntax.
authorWayne Davison <wayned@samba.org>
Thu, 22 Jan 2004 04:38:18 +0000 (04:38 +0000)
committerWayne Davison <wayned@samba.org>
Thu, 22 Jan 2004 04:38:18 +0000 (04:38 +0000)
generator.c
hlink.c
receiver.c
sender.c

index 579ffc3..a85567d 100644 (file)
@@ -561,8 +561,8 @@ void generate_files(int f, struct file_list *flist, char *local_name)
                        file = &copy;
                }
 
-               recv_generator(local_name? local_name
-                            : f_name_to(file,fbuf,sizeof fbuf), file, i, f);
+               recv_generator(local_name ? local_name : f_name_to(file, fbuf),
+                              file, i, f);
        }
 
        phase++;
@@ -578,8 +578,8 @@ void generate_files(int f, struct file_list *flist, char *local_name)
         * to catch initial checksum errors */
        while ((i = get_redo_num()) != -1) {
                struct file_struct *file = flist->files[i];
-               recv_generator(local_name? local_name
-                            : f_name_to(file,fbuf,sizeof fbuf), file, i, f);
+               recv_generator(local_name ? local_name : f_name_to(file, fbuf),
+                              file, i, f);
        }
 
        phase++;
diff --git a/hlink.c b/hlink.c
index 40a7aa9..d5600d3 100644 (file)
--- a/hlink.c
+++ b/hlink.c
@@ -137,8 +137,8 @@ void do_hard_links(void)
 {
 #if SUPPORT_HARD_LINKS
        struct file_struct *file;
-       char fbuf[MAXPATHLEN];
-       char *hlink1, *hlink2;
+       char hlink1[MAXPATHLEN];
+       char *hlink2;
        STRUCT_STAT st1, st2;
        int i;
 
@@ -147,8 +147,7 @@ void do_hard_links(void)
 
        for (i = 0; i < hlink_count; i++) {
                file = hlink_list[i];
-               hlink1 = f_name_to(file, fbuf, sizeof fbuf);
-               if (link_stat(hlink1, &st1) != 0)
+               if (link_stat(f_name_to(file, hlink1), &st1) != 0)
                        continue;
                while ((file = file->F_NEXT) != NULL) {
                        hlink2 = f_name(file);
index 246caea..e2fd13b 100644 (file)
@@ -94,7 +94,7 @@ void delete_files(struct file_list *flist)
                if (!S_ISDIR(flist->files[j]->mode) ||
                    !(flist->files[j]->flags & FLAG_DELETE)) continue;
 
-               name = f_name_to(flist->files[j], fbuf, sizeof fbuf);
+               name = f_name_to(flist->files[j], fbuf);
 
                if (!(local_file_list = send_file_list(-1,1,&name)))
                        continue;
@@ -335,7 +335,7 @@ int recv_files(int f_in,struct file_list *flist,char *local_name)
                if (local_name)
                        fname = local_name;
                else
-                       fname = f_name_to(file, fbuf, sizeof fbuf);
+                       fname = f_name_to(file, fbuf);
 
                if (dry_run) {
                        if (!am_server && verbose) {    /* log transfer */
@@ -486,8 +486,8 @@ int recv_files(int f_in,struct file_list *flist,char *local_name)
        for (i = 0; i < flist->count; i++) {
                file = flist->files[i];
                if (!file->basename || !S_ISDIR(file->mode)) continue;
-               recv_generator(local_name? local_name
-                            : f_name_to(file,fbuf,sizeof fbuf), file, i, -1);
+               recv_generator(local_name ? local_name : f_name_to(file, fbuf),
+                              file, i, -1);
        }
 
        if (verbose > 2)
index 8b649a8..d103b9a 100644 (file)
--- a/sender.c
+++ b/sender.c
@@ -130,7 +130,7 @@ void send_files(struct file_list *flist, int f_out, int f_in)
                rprintf(FINFO, "send_files starting\n");
 
        while (1) {
-               int offset = 0;
+               unsigned int offset;
 
                i = read_int(f_in);
                if (i == -1) {
@@ -161,14 +161,9 @@ void send_files(struct file_list *flist, int f_out, int f_in)
                if (file->basedir) {
                        offset = stringjoin(fname, sizeof fname,
                                            file->basedir, "/", NULL);
-                       if (offset >= MAXPATHLEN-1) {
-                               io_error |= IOERR_GENERAL;
-                               rprintf(FERROR, "send_files failed on long-named directory %s\n",
-                                       full_fname(fname));
-                               return;
-                       }
-               }
-               f_name_to(file, fname + offset, MAXPATHLEN - offset);
+               } else
+                       offset = 0;
+               f_name_to(file, fname + offset);
 
                if (verbose > 2)
                        rprintf(FINFO, "send_files(%d, %s)\n", i, fname);