diff options
author | Ian Dowse <iedowse@FreeBSD.org> | 2002-05-06 15:15:51 +0000 |
---|---|---|
committer | Ian Dowse <iedowse@FreeBSD.org> | 2002-05-06 15:15:51 +0000 |
commit | a255f2f8fafa555f49f30f6d90e9044d482b69f6 (patch) | |
tree | 0b7356b838db97ff1569efd2a55821ca2a28f3db /sbin/restore | |
parent | d2046935726836bd3ae4675bf98095e385b715f3 (diff) | |
download | src-a255f2f8fafa555f49f30f6d90e9044d482b69f6.tar.gz src-a255f2f8fafa555f49f30f6d90e9044d482b69f6.zip |
Address a few minor style and consistency issues in revision 1.32.
Submitted by: Joshua Goodall <joshua@roughtrade.net>
Notes
Notes:
svn path=/head/; revision=96113
Diffstat (limited to 'sbin/restore')
-rw-r--r-- | sbin/restore/tape.c | 38 |
1 files changed, 15 insertions, 23 deletions
diff --git a/sbin/restore/tape.c b/sbin/restore/tape.c index a8ae8f378bd0..f5b5438c5e08 100644 --- a/sbin/restore/tape.c +++ b/sbin/restore/tape.c @@ -529,6 +529,8 @@ int extractfile(char *name) { int flags; + uid_t uid; + gid_t gid; mode_t mode; struct timeval timep[2]; struct entry *ep; @@ -539,6 +541,8 @@ extractfile(char *name) timep[0].tv_usec = curfile.dip->di_atimensec / 1000; timep[1].tv_sec = curfile.dip->di_mtime; timep[1].tv_usec = curfile.dip->di_mtimensec / 1000; + uid = curfile.dip->di_uid; + gid = curfile.dip->di_gid; mode = curfile.dip->di_mode; flags = curfile.dip->di_flags; switch (mode & IFMT) { @@ -565,14 +569,6 @@ extractfile(char *name) return (genliteraldir(name, curfile.ino)); case IFLNK: - { - uid_t uid; - gid_t gid; - int ret; - - uid = curfile.dip->di_uid; - gid = curfile.dip->di_gid; - lnkbuf[0] = '\0'; pathlen = 0; getfile(xtrlnkfile, xtrlnkskip); @@ -581,17 +577,13 @@ extractfile(char *name) "%s: zero length symbolic link (ignored)\n", name); return (GOOD); } - ret = linkit(lnkbuf, name, SYMLINK); - if (ret == GOOD) { - if (lchown(name, uid, gid)) - perror(name); - if (lchmod(name, mode)) - perror(name); - lutimes(name, timep); + if (linkit(lnkbuf, name, SYMLINK) == GOOD) { + (void) lchown(name, uid, gid); + (void) lchmod(name, mode); + (void) lutimes(name, timep); + return (GOOD); } - /* symbolic link doesn't have any flags */ - return (ret); - } + return (FAIL); case IFIFO: vprintf(stdout, "extract fifo %s\n", name); @@ -607,9 +599,9 @@ extractfile(char *name) skipfile(); return (FAIL); } - (void) chown(name, curfile.dip->di_uid, curfile.dip->di_gid); + (void) chown(name, uid, gid); (void) chmod(name, mode); - utimes(name, timep); + (void) utimes(name, timep); (void) chflags(name, flags); skipfile(); return (GOOD); @@ -629,9 +621,9 @@ extractfile(char *name) skipfile(); return (FAIL); } - (void) chown(name, curfile.dip->di_uid, curfile.dip->di_gid); + (void) chown(name, uid, gid); (void) chmod(name, mode); - utimes(name, timep); + (void) utimes(name, timep); (void) chflags(name, flags); skipfile(); return (GOOD); @@ -651,7 +643,7 @@ extractfile(char *name) skipfile(); return (FAIL); } - (void) fchown(ofile, curfile.dip->di_uid, curfile.dip->di_gid); + (void) fchown(ofile, uid, gid); (void) fchmod(ofile, mode); getfile(xtrfile, xtrskip); (void) close(ofile); |