changeset 1180:f5bea35b4316

Print a message if chown() or chmod() fail.
author zas_
date Wed, 26 Nov 2008 20:38:47 +0000
parents de19d176bdbd
children 475986f8f298
files src/secure_save.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/secure_save.c	Wed Nov 26 20:37:14 2008 +0000
+++ b/src/secure_save.c	Wed Nov 26 20:38:47 2008 +0000
@@ -275,8 +275,8 @@
 			/* set the dest file attributes to that of source (ignoring errors) */
 			if (ssi->preserve_perms)
 				{
-				chown(ssi->tmp_file_name, st.st_uid, st.st_gid);
-				chmod(ssi->tmp_file_name, st.st_mode);
+				if (chown(ssi->tmp_file_name, st.st_uid, st.st_gid) != 0) log_printf("chown('%s', %d, %d) failed", ssi->tmp_file_name, st.st_uid, st.st_gid);
+				if (chmod(ssi->tmp_file_name, st.st_mode) != 0) log_printf("chmod('%s', %o) failed", ssi->tmp_file_name, st.st_mode);
 				}
 
 			if (ssi->preserve_mtime)