summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/install.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/src/install.c b/src/install.c
index 099fc5444..20931f63b 100644
--- a/src/install.c
+++ b/src/install.c
@@ -506,15 +506,25 @@ change_attributes (const char *path)
&& errno != EPERM
#endif
)
- err = errno;
- if (chmod (path, mode))
- err = errno;
+ {
+ error (0, errno, "cannot change ownership of `%s'", path);
+ err = 1;
+ }
+
+ if (!err && chmod (path, mode))
+ {
+ error (0, errno, "cannot change permissions of `%s'", path);
+ err = 1;
+ }
+
if (err)
{
- error (0, err, "%s", path);
- return 1;
+ error (0, 0, "removing file: `%s'", path);
+ if (unlink (path))
+ error (0, errno, "cannot remove `%s'", path);
}
- return 0;
+
+ return err;
}
/* Set the timestamps of file TO to match those of file FROM.