Skip to content

Commit

Permalink
Print a message if chown() or chmod() fail.
Browse files Browse the repository at this point in the history
  • Loading branch information
Laurent Monin committed Nov 26, 2008
1 parent a3cd380 commit 3f7d30d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/secure_save.c
Original file line number Diff line number Diff line change
Expand Up @@ -275,8 +275,8 @@ secure_close(SecureSaveInfo *ssi)
/* 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)
Expand Down

0 comments on commit 3f7d30d

Please sign in to comment.