summaryrefslogtreecommitdiffstats
path: root/bin/cp/utils.c
diff options
context:
space:
mode:
authormharo <mharo@FreeBSD.org>2000-01-23 03:04:49 +0000
committermharo <mharo@FreeBSD.org>2000-01-23 03:04:49 +0000
commit605075ef02d632699a256f83b46d6d36cde861bc (patch)
tree7f54fc426a666c12f98738195362d13c1ddb3178 /bin/cp/utils.c
parent9b2ca25495c0c15a2fd5d018f703711841f1b104 (diff)
downloadFreeBSD-src-605075ef02d632699a256f83b46d6d36cde861bc.zip
FreeBSD-src-605075ef02d632699a256f83b46d6d36cde861bc.tar.gz
fix cp -vi bug
Submitted by: Dan Papasian (bugg_ on irc)
Diffstat (limited to 'bin/cp/utils.c')
-rw-r--r--bin/cp/utils.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/bin/cp/utils.c b/bin/cp/utils.c
index 368886a..86ab3ab 100644
--- a/bin/cp/utils.c
+++ b/bin/cp/utils.c
@@ -50,6 +50,7 @@ static const char rcsid[] =
#include <fcntl.h>
#include <fts.h>
#include <stdio.h>
+#include <sysexits.h>
#include <unistd.h>
#include "extern.h"
@@ -93,7 +94,7 @@ copy_file(entp, dne)
if (checkch != 'y' && checkch != 'Y') {
(void)close(from_fd);
(void)fprintf(stderr, "not overwritten\n");
- return (0);
+ return (1);
}
}
@@ -324,5 +325,5 @@ usage()
(void)fprintf(stderr, "%s\n%s\n",
"usage: cp [-R [-H | -L | -P]] [-f | -i] [-pv] src target",
" cp [-R [-H | -L | -P]] [-f | -i] [-pv] src1 ... srcN directory");
- exit(1);
+ exit(EX_USAGE);
}
OpenPOWER on IntegriCloud