diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2008-09-02 17:19:10 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2008-09-02 17:19:10 +0200 |
commit | 6aa5d0c52e09c96a0b05a3dec8b3942a4771eba2 (patch) | |
tree | f2b4899ac8eed93ec81ed41bd09d0a697c0fe7a3 | |
parent | 6497c227420ff82ab15f43277fe97926a0b63485 (diff) | |
download | barebox-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>
-rw-r--r-- | commands/cp.c | 2 |
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; } |