diff options
author | seanc <seanc@FreeBSD.org> | 2002-12-17 04:26:22 +0000 |
---|---|---|
committer | seanc <seanc@FreeBSD.org> | 2002-12-17 04:26:22 +0000 |
commit | 8ff3d76f8de79310d39539d3d04c91eeae5b1265 (patch) | |
tree | 0580ce676b3a154d0f2e3d7f3246ae8a4f99fe39 /usr.bin/make | |
parent | 527408760d81666a3f0b220f592890afe1a1c8e1 (diff) | |
download | FreeBSD-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/make')
-rw-r--r-- | usr.bin/make/main.c | 3 |
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); |