summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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++ != ' ') {