summaryrefslogtreecommitdiffstats
path: root/usr.bin/make
diff options
context:
space:
mode:
authorharti <harti@FreeBSD.org>2005-05-12 11:16:04 +0000
committerharti <harti@FreeBSD.org>2005-05-12 11:16:04 +0000
commitc8542dc6a98be62cc45a8e5b53d423849bc8c0e9 (patch)
tree45c99b194b3f6c27e2077aab3f6af2224a27609e /usr.bin/make
parent1abbaf545acb15178d04473b510a962ad015ae7e (diff)
downloadFreeBSD-src-c8542dc6a98be62cc45a8e5b53d423849bc8c0e9.zip
FreeBSD-src-c8542dc6a98be62cc45a8e5b53d423849bc8c0e9.tar.gz
Move some comments around to where they belong and remove some unneccessary
gcc magic. Submitted by: Max Okumoto <okumoto@ucsd.edu> (7.229)
Diffstat (limited to 'usr.bin/make')
-rw-r--r--usr.bin/make/job.c73
-rw-r--r--usr.bin/make/parse.c9
2 files changed, 34 insertions, 48 deletions
diff --git a/usr.bin/make/job.c b/usr.bin/make/job.c
index be15e62..7ec42d2 100644
--- a/usr.bin/make/job.c
+++ b/usr.bin/make/job.c
@@ -96,6 +96,17 @@ __FBSDID("$FreeBSD$");
* Job_Touch Update a target without really updating it.
*
* Job_Wait Wait for all currently-running jobs to finish.
+ *
+ * compat.c --
+ * The routines in this file implement the full-compatibility
+ * mode of PMake. Most of the special functionality of PMake
+ * is available in this mode. Things not supported:
+ * - different shells.
+ * - friendly variable substitution.
+ *
+ * Interface:
+ * Compat_Run Initialize things for this module and recreate
+ * thems as need creatin'
*/
#include <sys/queue.h>
@@ -487,6 +498,24 @@ static void JobInterrupt(int, int);
static void JobRestartJobs(void);
static void ProcExec(const ProcStuff *) __dead2;
+/*
+ * The following array is used to make a fast determination of which
+ * commands and characters are interpreted specially by the shell.
+ * If a command is one of these or contains any of these characters,
+ * it is executed by the shell, not directly by us.
+ * XXX Both of these arrays should be configurable via .SHELL
+ */
+static const char const* sh_builtin[] = {
+ "alias", "cd", "eval", "exec",
+ "exit", "read", "set", "ulimit",
+ "unalias", "umask", "unset", "wait",
+ ":", NULL
+};
+static const char *sh_meta = "#=|^(){};&<>*?[]:$`\\\n";
+
+static GNode *curTarg = NULL;
+static GNode *ENDNode;
+
/**
* Replace the current process.
*/
@@ -3083,36 +3112,6 @@ Cmd_Exec(const char *cmd, const char **error)
}
-/*-
- * compat.c --
- * The routines in this file implement the full-compatibility
- * mode of PMake. Most of the special functionality of PMake
- * is available in this mode. Things not supported:
- * - different shells.
- * - friendly variable substitution.
- *
- * Interface:
- * Compat_Run Initialize things for this module and recreate
- * thems as need creatin'
- */
-
-/*
- * The following array is used to make a fast determination of which
- * characters are interpreted specially by the shell. If a command
- * contains any of these characters, it is executed by the shell, not
- * directly by us.
- */
-static const char const* sh_builtin[] = {
- "alias", "cd", "eval", "exec",
- "exit", "read", "set", "ulimit",
- "unalias", "umask", "unset", "wait",
- ":", NULL
-};
-static const char *sh_meta = "#=|^(){};&<>*?[]:$`\\\n";
-
-static GNode *curTarg = NULL;
-static GNode *ENDNode;
-
/*
* Interrupt handler - set flag and defer handling to the main code
*/
@@ -3241,14 +3240,6 @@ Compat_RunCommand(char *cmd, GNode *gn)
char *cmd_save; /* saved cmd */
ProcStuff ps;
- /*
- * Avoid clobbered variable warnings by forcing the compiler
- * to ``unregister'' variables
- */
-#if __GNUC__
- (void)&av;
- (void)&errCheck;
-#endif
silent = gn->type & OP_SILENT;
errCheck = !(gn->type & OP_IGNORE);
doit = FALSE;
@@ -3377,11 +3368,15 @@ Compat_RunCommand(char *cmd, GNode *gn)
* The child is off and running. Now all we can do is wait...
*/
reason = ProcWait(&ps);
+
if (interrupted)
CompatInterrupt(interrupted);
+ /*
+ * Decode and report the reason child exited, then
+ * indicate how we handled it.
+ */
if (WIFEXITED(reason)) {
- /* exited */
status = WEXITSTATUS(reason);
if (status == 0) {
return (0);
diff --git a/usr.bin/make/parse.c b/usr.bin/make/parse.c
index 05cd8e3..4df224f 100644
--- a/usr.bin/make/parse.c
+++ b/usr.bin/make/parse.c
@@ -1385,15 +1385,6 @@ Parse_DoVar(char *line, GNode *ctxt)
* null-terminate the variable name */
/*
- * Avoid clobbered variable warnings by forcing the compiler
- * to ``unregister'' variables
- */
-#if __GNUC__
- (void)&cp;
- (void)&line;
-#endif
-
- /*
* Skip to variable name
*/
while (*line == ' ' || *line == '\t') {
OpenPOWER on IntegriCloud