Hello, 
as reported in https://bugzilla.redhat.com/show_bug.cgi?id=500742 by
Bruce Jerrick, tar --atime-preserve produces an error when source files
are on read-only filesystem as it tries utime() to reset atime, and that
fails. Attached patch should fix that behaviour - ignoring EROFS return
value.

Greetings,
         Ondřej Vašík
diff -urNp tar-1.22-orig/src/create.c tar-1.22/src/create.c
--- tar-1.22-orig/src/create.c	2009-05-15 10:50:38.000000000 +0200
+++ tar-1.22/src/create.c	2009-05-15 10:51:52.000000000 +0200
@@ -1691,7 +1691,8 @@ dump_file0 (struct tar_stat_info *st, co
 		exit_status = TAREXIT_DIFFERS;
 	    }
 	  else if (atime_preserve_option == replace_atime_preserve
-		   && set_file_atime (fd, p, restore_times) != 0)
+		   && set_file_atime (fd, p, restore_times) != 0
+		   && errno != EROFS )
 	    utime_error (p);
 	}
 

Attachment: signature.asc
Description: Toto je digitálně podepsaná část zprávy

Reply via email to