summaryrefslogtreecommitdiffstats
path: root/sbin/restore
diff options
context:
space:
mode:
authoriedowse <iedowse@FreeBSD.org>2002-05-06 15:15:51 +0000
committeriedowse <iedowse@FreeBSD.org>2002-05-06 15:15:51 +0000
commitc0fc7526c045be718c8d116a881823f9b4718e77 (patch)
tree0b7356b838db97ff1569efd2a55821ca2a28f3db /sbin/restore
parent2933c200cb106974504a6644e3b45f410b7cd065 (diff)
downloadFreeBSD-src-c0fc7526c045be718c8d116a881823f9b4718e77.zip
FreeBSD-src-c0fc7526c045be718c8d116a881823f9b4718e77.tar.gz
Address a few minor style and consistency issues in revision 1.32.
Submitted by: Joshua Goodall <joshua@roughtrade.net>
Diffstat (limited to 'sbin/restore')
-rw-r--r--sbin/restore/tape.c38
1 files changed, 15 insertions, 23 deletions
diff --git a/sbin/restore/tape.c b/sbin/restore/tape.c
index a8ae8f3..f5b5438 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);
OpenPOWER on IntegriCloud