summaryrefslogtreecommitdiff
path: root/usr.bin/oldrdist
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1996-05-28 12:31:58 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1996-05-28 12:31:58 +0000
commit73cc66b2c760a2ba2688f6b95ad26bf7fbd9d34c (patch)
tree04813c28b7732577e1cb47cffffc880b3dc9de9d /usr.bin/oldrdist
parent038a5a4cd87f32548052faede06c75153521be74 (diff)
sync
Diffstat (limited to 'usr.bin/oldrdist')
-rw-r--r--usr.bin/oldrdist/server.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/usr.bin/oldrdist/server.c b/usr.bin/oldrdist/server.c
index c3ef0e19de8..52caf4f272f 100644
--- a/usr.bin/oldrdist/server.c
+++ b/usr.bin/oldrdist/server.c
@@ -33,7 +33,7 @@
#ifndef lint
/* from: static char sccsid[] = "@(#)server.c 8.1 (Berkeley) 6/9/93"; */
-static char *rcsid = "$Id: server.c,v 1.1 1996/02/03 12:12:03 dm Exp $";
+static char *rcsid = "$Id: server.c,v 1.2 1996/05/28 12:31:57 deraadt Exp $";
#endif /* not lint */
#include <sys/wait.h>
@@ -692,8 +692,8 @@ recvf(cmd, type)
char *cmd;
int type;
{
- register char *cp;
- int f, mode, opts, wrerr, olderrno;
+ register char *cp = cmd;
+ int f = -1, mode, opts = 0, wrerr, olderrno;
off_t i, size;
time_t mtime;
struct stat stb;
@@ -919,7 +919,7 @@ differ: buf[0] = '\0';
if (fchog(f, new, owner, group, mode) < 0) {
badnew2:
- if (f) /* Don't close if f hasn't been opened. */
+ if (f == -1)
(void) close(f);
(void) unlink(new);
return;
@@ -952,8 +952,6 @@ hardlink(cmd)
char *oldname;
int opts, exists = 0;
- cp = cmd;
- opts = 0;
while (*cp >= '0' && *cp <= '7')
opts = (opts << 3) | (*cp++ - '0');
if (*cp++ != ' ') {