From 8ff3d76f8de79310d39539d3d04c91eeae5b1265 Mon Sep 17 00:00:00 2001 From: seanc Date: Tue, 17 Dec 2002 04:26:22 +0000 Subject: Check the return status of chdir() when using the -C option. Reviewed by: bright && jmallet MFC after: 1 day --- usr.bin/make/main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'usr.bin') 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); -- cgit v1.1