summaryrefslogtreecommitdiffstats
path: root/usr.bin
diff options
context:
space:
mode:
authorseanc <seanc@FreeBSD.org>2002-12-17 04:26:22 +0000
committerseanc <seanc@FreeBSD.org>2002-12-17 04:26:22 +0000
commit8ff3d76f8de79310d39539d3d04c91eeae5b1265 (patch)
tree0580ce676b3a154d0f2e3d7f3246ae8a4f99fe39 /usr.bin
parent527408760d81666a3f0b220f592890afe1a1c8e1 (diff)
downloadFreeBSD-src-8ff3d76f8de79310d39539d3d04c91eeae5b1265.zip
FreeBSD-src-8ff3d76f8de79310d39539d3d04c91eeae5b1265.tar.gz
Check the return status of chdir() when using the -C option.
Reviewed by: bright && jmallet MFC after: 1 day
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/make/main.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/usr.bin/make/main.c b/usr.bin/make/main.c
index e80ff06..24211ba 100644
--- a/usr.bin/make/main.c
+++ b/usr.bin/make/main.c
@@ -159,7 +159,8 @@ MainParseArgs(int argc, char **argv)
rearg: while((c = getopt(argc, argv, OPTFLAGS)) != -1) {
switch(c) {
case 'C':
- chdir(optarg);
+ if (chdir(optarg) == -1)
+ err(1, "chdir %s", optarg);
break;
case 'D':
Var_Set(optarg, "1", VAR_GLOBAL);
OpenPOWER on IntegriCloud