Displaying 20 results from an estimated 21 matches for "unmap_fil".
Did you mean:
  unmap_file
  
2001 Nov 13
2
direct write patch
...extern int preserve_perms;
 	extern int delete_after;
 	struct stats initial_stats;
+	int write_flags;
 
 	if (verbose > 2) {
 		rprintf(FINFO,"recv_files(%d) starting\n",flist->count);
@@ -404,22 +407,29 @@
 			buf = NULL;
 		}
 
-		if (!get_tmpname(fnametmp,fname)) {
-			if (buf) unmap_file(buf);
-			if (fd1 != -1) close(fd1);
-			continue;
-		}
+		if(direct_write) {
+			fnametmp = fname;
+			write_flags = O_WRONLY|O_CREAT;
+		} else {
+			fnametmp = fnametmpbuf;
+			if (!get_tmpname(fnametmp,fname)) {
+				if (buf) unmap_file(buf);
+				if (fd1 != -1) close(fd1);
+				continue;
+...
2004 Apr 27
1
[PATCH] Inplace option for rsync
...e(fd);
 
+       if (inplace)
+               ftruncate(fd, offset);
+
        if (do_progress)
                end_progress(total_size);
 
@@ -410,39 +424,52 @@
                } else
                 mapbuf = NULL;
 
-               if (!get_tmpname(fnametmp,fname)) {
-                if (mapbuf) unmap_file(mapbuf);
-                if (fd1 != -1) close(fd1);
-                continue;
-               }
-
-               strlcpy(template, fnametmp, sizeof template);
+               /* We now check to see if we are writing file "inplace" */
+               if (inplace)  {
+                fd...
2002 Jun 07
0
problem related to filename length
...nametmp,MAXPATHLEN, "%s",fname);
+		  strncpy(fnametmp + strlen(fnametmp) - 6,"XXXXXX",6);
+		}else
+		  snprintf(fnametmp,MAXPATHLEN,".%s.XXXXXX",fname);
 	}
 
 	return 1;
@@ -408,21 +429,33 @@
 			buf = NULL;
 		}
 
-		if (!get_tmpname(fnametmp,fname)) {
-			if (buf) unmap_file(buf);
-			if (fd1 != -1) close(fd1);
-			continue;
+		{
+		  static const int max_retry = 10;
+		  int retry = 0;
+		  int flag = 0;
+
+		  do {
+		    if (!get_tmpname(fnametmp,fname)) {
+		      if (buf) unmap_file(buf);
+		      if (fd1 != -1) close(fd1);
+		      flag = 1;
+		      break;
+...
2003 Jan 18
1
possible typo/bug in receiver.c
...race condition. */
        fd2 = do_mkstemp(fnametmp, file->mode & INITACCESSPERMS);
        if (fd2 == -1) {
                rprintf(FERROR,"mkstemp %s failed: %s\n",fnametmp,strerror(errno));
                receive_data(f_in,buf,-1,NULL,file->length);
                if (buf) unmap_file(buf);
                if (fd1 != -1) close(fd1);
                continue;
        }
        /* in most cases parent directories will already exist
           because their information should have been previously
           transferred, but that may not be the case with -R */
        if (fd2 == -...
2003 Nov 17
0
[PATCH] --source-filter && --dest-filter for rsync 2.5.6
...2);
+		}
+
 		/* recv file data */
 		recv_ok = receive_data(f_in,buf,fd2,fname,file->length);
 
+		if (dest_filter) {
+			close(fd2);
+			wait_process(pid, &status);
+			if (status != 0) {
+				rprintf(FERROR,"filter %s exited code: %d\n",
+					dest_filter, status);
+				if (buf) unmap_file(buf);
+				if (fd1 != -1) close(fd1);
+				continue;
+			}
+		}
+
 		log_recv(file, &initial_stats);
 		
 		if (buf) unmap_file(buf);
 		if (fd1 != -1) {
 			close(fd1);
 		}
-		close(fd2);
+		if (! dest_filter) {
+			close(fd2);
+		}
 		
 		if (verbose > 2)
 			rprintf(FINFO,"renaming...
2002 Apr 23
1
patch: timeout problem solved
...if (verbose > 2)
-		rprintf(FINFO,"sending sums for %d\n",i);
+		rprintf(FINFO,"generating and sending sums for %d\n",i);
 
-	write_int(f_out,i);
-	send_sums(s,f_out);
+	generate_and_send_sums(buf,st.st_size,adapt_block_size(file, block_size),f_out);
 
 	close(fd);
 	if (buf) unmap_file(buf);
-
-	free_sums(s);
 }
2004 Jun 17
1
[PATCH] make write_batch local
...ck(file, HL_SKIP))
  			return;
! 		write_null_sum(f_out, i);
  		return;
  	}
  
***************
*** 533,539 ****
  		rprintf(FINFO, "generating and sending sums for %d\n", i);
  
  	write_int(f_out,i);
! 	generate_and_send_sums(mapbuf, st.st_size, f_out);
  
  	close(fd);
  	if (mapbuf) unmap_file(mapbuf);
--- 559,565 ----
  		rprintf(FINFO, "generating and sending sums for %d\n", i);
  
  	write_int(f_out,i);
! 	generate_and_send_sums(mapbuf, st.st_size, f_out, i);
  
  	close(fd);
  	if (mapbuf) unmap_file(mapbuf);
Index: main.c
==================================================...
2002 Sep 10
0
[PATCH] Add --preserve-atime switch to rsync
...uot;fstat failed :
%s\n",strerror(errno));
  				free_sums(s);
  				close(fd);
+ 				if (preserve_atime)
+ 					set_modtime(fname, file->modtime,
file->acctime);
  				return;
  			}
  	  
***************
*** 266,271 ****
--- 281,288 ----
  		if (!read_batch) { /* dw */
  		    if (buf) unmap_file(buf);
  		    close(fd);
+ 		    if (preserve_atime)
+ 			set_modtime(fname, file->modtime, file->acctime);
  		}
  	  
  		free_sums(s);
*** util.c@@/main/original/1 Tue Apr  9 14:04:04 2002
--- util.c Tue Apr  9 15:22:00 2002
***************
*** 240,246 ****
  
  
  
! int set_modtime(cha...
2009 Nov 04
0
PATCH: fast copy of files in local server mode
...lt; 0 && percent < offset * 100 / total_size) {
+				/* report progress of fast copy to sender every 1% -goldor */
+				write_buf(local_socket, (char *)&offset, sizeof(offset));
+				percent = offset * 100 / total_size;
+			}
 			continue;
 		}
 
@@ -307,6 +328,12 @@
 	if (mapbuf)
 		unmap_file(mapbuf);
 
+	if (f_in < 0) {
+		/* close fast copy handle -goldor */
+		close(-f_in);
+		return 1;
+	}
+
 	read_buf(f_in, file_sum2, sum_len);
 	if (verbose > 2)
 		rprintf(FINFO,"got file_sum\n");
diff -au rsync-3.0.6/sender.c rsync-3.0.6.fast/sender.c
--- rsync-3.0.6/sender.c	200...
2004 May 10
2
read error produces null-byte-filled destination file
I've run into a bug in the IO handling when reading a file.  Suppose I
have a file that lives on an NFS filesystem.  That filesystem is NOT
being exported with auth=0 permissions.  So, if I try to access a file
as root, it successfully opens the file, but subsequent reads fail with
EACCES.  This produces a destination file full of null bytes.  I
noticed this with 2.5.7, but checked 2.6.2 as
2001 Aug 06
1
merge rsync+ into rsync (was Re: rsync-2.4.7 NEWS file)
> Just curious: what about the rsync+ patch?
Thanks for the reminder.
I've just committed Jos's rsync+ patch onto the
"branch_mbp_rsyncplus_merge" branch.  If it works OK and nobody
screams I will move it across onto the main tree tomorrow or
Wednesday.
I see the patch doesn't add documentation about the new options to the
man page, so we should fix that in the future.
2003 Mar 30
1
[RFC][patch] dynamic rolling block and sum sizes II
...M_LENGTH];
@@ -465,8 +517,7 @@
 		rprintf(FINFO, "generating and sending sums for %d\n", i);
 
 	write_int(f_out,i);
-	generate_and_send_sums(buf, st.st_size,
-			       adapt_block_size(file, block_size), f_out);
+	generate_and_send_sums(buf, st.st_size, f_out);
 
 	close(fd);
 	if (buf) unmap_file(buf);
2003 Feb 22
1
rsync ported to BeOS-bone
...,NULL,file->length);
 			close(fd1);
 			continue;
 		}
@@ -436,7 +436,7 @@
 		}
 		if (fd2 == -1) {
 			rprintf(FERROR,"mkstemp %s failed: %s\n",fnametmp,strerror(errno));
-			receive_data(f_in,buf,-1,NULL,file->length);
+			recv_data(f_in,buf,-1,NULL,file->length);
 			if (buf) unmap_file(buf);
 			if (fd1 != -1) close(fd1);
 			continue;
@@ -449,7 +449,7 @@
 		}
 
 		/* recv file data */
-		recv_ok = receive_data(f_in,buf,fd2,fname,file->length);
+		recv_ok = recv_data(f_in,buf,fd2,fname,file->length);
 
 		log_recv(file, &initial_stats);
 		
--- rsync-2.5.6.org/batch.c...
2004 Feb 09
1
[patch] Add `--link-by-hash' option.
...close(fd1);
 			continue;
 		}
@@ -482,7 +493,7 @@
 		if (fd2 == -1) {
 			rprintf(FERROR, "mkstemp %s failed: %s\n",
 				full_fname(fnametmp), strerror(errno));
-			receive_data(f_in,buf,-1,NULL,file->length);
+			receive_data(f_in,buf,-1,NULL,file->length,NULL);
 			if (buf) unmap_file(buf);
 			if (fd1 != -1) close(fd1);
 			continue;
@@ -495,7 +506,12 @@
 		}
 
 		/* recv file data */
-		recv_ok = receive_data(f_in,buf,fd2,fname,file->length);
+#ifdef HAVE_LINK
+		if (link_by_hash_dir) {
+			file->sum = (char*)malloc (MD4_SUM_LENGTH);
+		}
+#endif
+		recv_ok = receive_da...
2002 Aug 05
5
[patch] read-devices
...-		map->p_fd_offset += nread;
 	}
 
 	map->p_offset = window_start;
 	map->p_len = window_size;
   
-	return map->p + (offset - map->p_offset); 
+	map->m_ptr = map->p + (offset - map->p_offset);
+	map->m_len = MIN(len, map->p_offset+map->p_len-offset);
 }
 
 
 void unmap_file(struct map_struct *map)
diff -r -u4 rsync-2.5.5/flist.c rsync-patched/flist.c
--- rsync-2.5.5/flist.c	Fri Mar 15 00:20:20 2002
+++ rsync-patched/flist.c	Mon Aug  5 10:05:15 2002
@@ -729,9 +729,9 @@
 		/* drat. we have to provide a null checksum for non-regular
 		   files in order to be compatible...
2004 Feb 23
0
[patch] Add `--link-by-hash' option (rev 4).
...e(fd1);
 			continue;
 		}
@@ -437,7 +447,7 @@
 		if (fd2 == -1) {
 			rprintf(FERROR, "mkstemp %s failed: %s\n",
 				full_fname(fnametmp), strerror(errno));
-			receive_data(f_in,mapbuf,-1,NULL,file->length);
+			receive_data(f_in,mapbuf,-1,NULL,file->length,NULL);
 			if (mapbuf) unmap_file(mapbuf);
 			if (fd1 != -1) close(fd1);
 			continue;
@@ -450,7 +460,12 @@
 		}
 
 		/* recv file data */
-		recv_ok = receive_data(f_in,mapbuf,fd2,fname,file->length);
+#ifdef HAVE_LINK
+		if (link_by_hash_dir) {
+			file->u.sum = (char*)malloc (MD4_SUM_LENGTH);
+		}
+#endif
+		recv_ok = re...
2004 Feb 17
0
[patch] Add `--link-by-hash' option (rev 3).
...e(fd1);
 			continue;
 		}
@@ -437,7 +447,7 @@
 		if (fd2 == -1) {
 			rprintf(FERROR, "mkstemp %s failed: %s\n",
 				full_fname(fnametmp), strerror(errno));
-			receive_data(f_in,mapbuf,-1,NULL,file->length);
+			receive_data(f_in,mapbuf,-1,NULL,file->length,NULL);
 			if (mapbuf) unmap_file(mapbuf);
 			if (fd1 != -1) close(fd1);
 			continue;
@@ -450,7 +460,12 @@
 		}
 
 		/* recv file data */
-		recv_ok = receive_data(f_in,mapbuf,fd2,fname,file->length);
+#ifdef HAVE_LINK
+		if (link_by_hash_dir) {
+			file->u.sum = (char*)malloc (MD4_SUM_LENGTH);
+		}
+#endif
+		recv_ok = re...
2004 Feb 23
0
[patch] Add `--link-by-hash' option (rev 5).
...e(fd1);
 			continue;
 		}
@@ -437,7 +447,7 @@
 		if (fd2 == -1) {
 			rprintf(FERROR, "mkstemp %s failed: %s\n",
 				full_fname(fnametmp), strerror(errno));
-			receive_data(f_in,mapbuf,-1,NULL,file->length);
+			receive_data(f_in,mapbuf,-1,NULL,file->length,NULL);
 			if (mapbuf) unmap_file(mapbuf);
 			if (fd1 != -1) close(fd1);
 			continue;
@@ -450,7 +460,12 @@
 		}
 
 		/* recv file data */
-		recv_ok = receive_data(f_in,mapbuf,fd2,fname,file->length);
+#ifdef HAVE_LINK
+		if (link_by_hash_dir) {
+			file->u.sum = (char*)malloc (MD4_SUM_LENGTH);
+		}
+#endif
+		recv_ok = re...
2004 Feb 16
1
[patch] Add `--link-by-hash' option (rev 2).
...e(fd1);
 			continue;
 		}
@@ -437,7 +447,7 @@
 		if (fd2 == -1) {
 			rprintf(FERROR, "mkstemp %s failed: %s\n",
 				full_fname(fnametmp), strerror(errno));
-			receive_data(f_in,mapbuf,-1,NULL,file->length);
+			receive_data(f_in,mapbuf,-1,NULL,file->length,NULL);
 			if (mapbuf) unmap_file(mapbuf);
 			if (fd1 != -1) close(fd1);
 			continue;
@@ -450,7 +460,12 @@
 		}
 
 		/* recv file data */
-		recv_ok = receive_data(f_in,mapbuf,fd2,fname,file->length);
+#ifdef HAVE_LINK
+		if (link_by_hash_dir) {
+			file->u.sum = (char*)malloc (MD4_SUM_LENGTH);
+		}
+#endif
+		recv_ok = re...
2003 Mar 23
1
[RFC] dynamic checksum size
...&sum);
@@ -458,8 +469,7 @@
 		rprintf(FINFO, "generating and sending sums for %d\n", i);
 
 	write_int(f_out,i);
-	generate_and_send_sums(buf, st.st_size,
-			       adapt_block_size(file, block_size), f_out);
+	generate_and_send_sums(buf, st.st_size, f_out);
 
 	close(fd);
 	if (buf) unmap_file(buf);
--- options.c		Sat Mar 22 11:16:03 2003
+++ options.c.varsumlen	Sat Mar 22 10:40:13 2003
@@ -72,7 +72,7 @@
 int keep_partial=0;
 int safe_symlinks=0;
 int copy_unsafe_links=0;
-int block_size=BLOCK_SIZE;
+int block_size=0;
 int size_only=0;
 int bwlimit=0;
 int delete_after=0;
@@ -725,7 +725...