- The combination of --update and --progress now outputs progress
authorWayne Davison <wayned@samba.org>
Sat, 30 Jul 2005 16:14:22 +0000 (16:14 +0000)
committerWayne Davison <wayned@samba.org>
Sat, 30 Jul 2005 16:14:22 +0000 (16:14 +0000)
  information during the checksum scan of the already-sent data.
- When --inplace creates a file, give it 0600 permissions, not 0000.

receiver.c

index d348cf8..46e456e 100644 (file)
@@ -219,12 +219,16 @@ static int receive_data(int f_in, char *fname_r, int fd_r, OFF_T size_r,
                if (sum.remainder)
                        sum.flength -= sum.blength - sum.remainder;
                for (j = CHUNK_SIZE; j < sum.flength; j += CHUNK_SIZE) {
                if (sum.remainder)
                        sum.flength -= sum.blength - sum.remainder;
                for (j = CHUNK_SIZE; j < sum.flength; j += CHUNK_SIZE) {
+                       if (do_progress)
+                               show_progress(offset, total_size);
                        sum_update(map_ptr(mapbuf, offset, CHUNK_SIZE),
                                   CHUNK_SIZE);
                        offset = j;
                }
                if (offset < sum.flength) {
                        int32 len = sum.flength - offset;
                        sum_update(map_ptr(mapbuf, offset, CHUNK_SIZE),
                                   CHUNK_SIZE);
                        offset = j;
                }
                if (offset < sum.flength) {
                        int32 len = sum.flength - offset;
+                       if (do_progress)
+                               show_progress(offset, total_size);
                        sum_update(map_ptr(mapbuf, offset, len), len);
                        offset = sum.flength;
                }
                        sum_update(map_ptr(mapbuf, offset, len), len);
                        offset = sum.flength;
                }
@@ -605,7 +609,7 @@ int recv_files(int f_in, struct file_list *flist, char *local_name)
 
                /* We now check to see if we are writing file "inplace" */
                if (inplace)  {
 
                /* We now check to see if we are writing file "inplace" */
                if (inplace)  {
-                       fd2 = do_open(fname, O_WRONLY|O_CREAT, 0);
+                       fd2 = do_open(fname, O_WRONLY|O_CREAT, 0600);
                        if (fd2 == -1) {
                                rsyserr(FERROR, errno, "open %s failed",
                                        full_fname(fname));
                        if (fd2 == -1) {
                                rsyserr(FERROR, errno, "open %s failed",
                                        full_fname(fname));