diff options
Diffstat (limited to 'bin/cp')
-rw-r--r-- | bin/cp/cp.c | 4 | ||||
-rw-r--r-- | bin/cp/utils.c | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/bin/cp/cp.c b/bin/cp/cp.c index c0a0d63dbeb..791e1d18c54 100644 --- a/bin/cp/cp.c +++ b/bin/cp/cp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cp.c,v 1.52 2019/01/28 18:58:42 jca Exp $ */ +/* $OpenBSD: cp.c,v 1.53 2019/06/28 13:34:58 deraadt Exp $ */ /* $NetBSD: cp.c,v 1.14 1995/09/07 06:14:51 jtc Exp $ */ /* @@ -425,7 +425,7 @@ copy(char *argv[], enum op type, int fts_options) */ if (fts_dne(curr)) { if (mkdir(to.p_path, - curr->fts_statp->st_mode | S_IRWXU) < 0) + curr->fts_statp->st_mode | S_IRWXU) == -1) err(1, "%s", to.p_path); else if (vflag) (void)fprintf(stdout, "%s -> %s\n", diff --git a/bin/cp/utils.c b/bin/cp/utils.c index 2275c127b76..a2f480c3393 100644 --- a/bin/cp/utils.c +++ b/bin/cp/utils.c @@ -1,4 +1,4 @@ -/* $OpenBSD: utils.c,v 1.47 2019/01/28 18:58:42 jca Exp $ */ +/* $OpenBSD: utils.c,v 1.48 2019/06/28 13:34:58 deraadt Exp $ */ /* $NetBSD: utils.c,v 1.6 1997/02/26 14:40:51 cgd Exp $ */ /*- @@ -129,7 +129,7 @@ copy_file(FTSENT *entp, int exists) rval = 1; } /* Some systems don't unmap on close(2). */ - if (munmap(p, fs->st_size) < 0) { + if (munmap(p, fs->st_size) == -1) { warn("%s", entp->fts_path); rval = 1; } @@ -152,9 +152,9 @@ copy_file(FTSENT *entp, int exists) break; } } - if (skipholes && rcount >= 0) + if (skipholes && rcount != -1) rcount = ftruncate(to_fd, lseek(to_fd, 0, SEEK_CUR)); - if (rcount < 0) { + if (rcount == -1) { warn("%s", entp->fts_path); rval = 1; } |