summaryrefslogtreecommitdiffstats
path: root/commands/cp.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2008-09-02 17:19:10 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2008-09-02 17:19:10 +0200
commit6aa5d0c52e09c96a0b05a3dec8b3942a4771eba2 (patch)
treef2b4899ac8eed93ec81ed41bd09d0a697c0fe7a3 /commands/cp.c
parent6497c227420ff82ab15f43277fe97926a0b63485 (diff)
downloadbarebox-6aa5d0c52e09c96a0b05a3dec8b3942a4771eba2.tar.gz
barebox-6aa5d0c52e09c96a0b05a3dec8b3942a4771eba2.tar.xz
cp: check return value of read()
...and not if the function read is non NULL. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'commands/cp.c')
-rw-r--r--commands/cp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/commands/cp.c b/commands/cp.c
index f2b8841121..af03615f5d 100644
--- a/commands/cp.c
+++ b/commands/cp.c
@@ -63,7 +63,7 @@ static int copy_file(const char *src, const char *dst)
while(1) {
r = read(srcfd, rw_buf, RW_BUF_SIZE);
- if (read < 0) {
+ if (r < 0) {
perror("read");
goto out;
}