aboutsummaryrefslogtreecommitdiffstats
path: root/backup.c
diff options
context:
space:
mode:
authorWayne Davison <wayned@samba.org>2006-01-26 10:38:58 +0000
committerWayne Davison <wayned@samba.org>2006-01-26 10:38:58 +0000
commitb5c6a6aeeb7d526e023454ea681b7381945bced8 (patch)
tree4b1c648dec10161a76bb8bdb013b38a4ec1362c1 /backup.c
parent4e7d07c8d4c75f0fc4207f0d6058db99b61c2f17 (diff)
downloadandroid_external_rsync-b5c6a6aeeb7d526e023454ea681b7381945bced8.tar.gz
android_external_rsync-b5c6a6aeeb7d526e023454ea681b7381945bced8.tar.bz2
android_external_rsync-b5c6a6aeeb7d526e023454ea681b7381945bced8.zip
Handle separated devices and special files.
Diffstat (limited to 'backup.c')
-rw-r--r--backup.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/backup.c b/backup.c
index d36524a8..11011cfd 100644
--- a/backup.c
+++ b/backup.c
@@ -30,6 +30,7 @@ extern char *backup_dir;
extern int am_root;
extern int preserve_devices;
+extern int preserve_specials;
extern int preserve_links;
extern int preserve_hard_links;
extern int orig_umask;
@@ -187,7 +188,8 @@ static int keep_backup(char *fname)
return 0;
/* Check to see if this is a device file, or link */
- if (IS_DEVICE(file->mode) && am_root && preserve_devices) {
+ if ((am_root && preserve_devices && IS_DEVICE(file->mode))
+ || (preserve_specials && IS_SPECIAL(file->mode))) {
do_unlink(buf);
if (do_mknod(buf, file->mode, file->u.rdev) < 0
&& (errno != ENOENT || make_bak_dir(buf) < 0