projects
/
unix-history
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
tags
|
clone url
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
change "file changed size" error to a real read error message
[unix-history]
/
usr
/
src
/
bin
/
rcp
/
rcp.c
diff --git
a/usr/src/bin/rcp/rcp.c
b/usr/src/bin/rcp/rcp.c
index
aabe5c1
..
dd62549
100644
(file)
--- a/
usr/src/bin/rcp/rcp.c
+++ b/
usr/src/bin/rcp/rcp.c
@@
-11,7
+11,7
@@
char copyright[] =
#endif not lint
#ifndef lint
#endif not lint
#ifndef lint
-static char sccsid[] = "@(#)rcp.c 5.
7
(Berkeley) %G%";
+static char sccsid[] = "@(#)rcp.c 5.
8
(Berkeley) %G%";
#endif not lint
/*
#endif not lint
/*
@@
-303,7
+303,7
@@
source(argc, argv)
struct stat stb;
static struct buffer buffer;
struct buffer *bp;
struct stat stb;
static struct buffer buffer;
struct buffer *bp;
- int x,
siz
err, f, amt;
+ int x,
read
err, f, amt;
off_t i;
char buf[BUFSIZ];
off_t i;
char buf[BUFSIZ];
@@
-362,20
+362,20
@@
notreg:
(void) close(f);
continue;
}
(void) close(f);
continue;
}
-
siz
err = 0;
+
read
err = 0;
for (i = 0; i < stb.st_size; i += bp->cnt) {
amt = bp->cnt;
if (i + amt > stb.st_size)
amt = stb.st_size - i;
for (i = 0; i < stb.st_size; i += bp->cnt) {
amt = bp->cnt;
if (i + amt > stb.st_size)
amt = stb.st_size - i;
- if (
siz
err == 0 && read(f, bp->buf, amt) != amt)
-
sizerr = 1
;
+ if (
read
err == 0 && read(f, bp->buf, amt) != amt)
+
readerr = errno
;
(void) write(rem, bp->buf, amt);
}
(void) close(f);
(void) write(rem, bp->buf, amt);
}
(void) close(f);
- if (
siz
err == 0)
+ if (
read
err == 0)
ga();
else
ga();
else
- error("rcp: %s:
file changed size\n", name
);
+ error("rcp: %s:
%s\n", name, sys_errlist[readerr]
);
(void) response();
}
}
(void) response();
}
}