aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cbs.h10
1 files changed, 2 insertions, 8 deletions
diff --git a/cbs.h b/cbs.h
index 3a24b30..b2a78fe 100644
--- a/cbs.h
+++ b/cbs.h
@@ -109,7 +109,7 @@ static void cmdaddv(struct cmd *, char **p, size_t n);
*(c)->argv = NULL; \
} while (0)
-/* The cmdexec() function executes the given command and waits for it to
+/* The cmdexec() macro executes the given command and waits for it to
terminate, returning its exit code. The cmdexeca() function executes the
given command and returns immediately, returning its process ID.
@@ -118,9 +118,9 @@ static void cmdaddv(struct cmd *, char **p, size_t n);
size of the output in *n.
cmdexec() and cmdexecb() have the same return values as cmdwait(). */
-static int cmdexec(struct cmd);
static pid_t cmdexeca(struct cmd);
static int cmdexecb(struct cmd, char **p, size_t *n);
+#define cmdexec(c) cmdwait(cmdexeca(c));
/* Wait for the process with the given PID to terminate, and return its exit
status. If the process was terminated by a signal 256 is returned. */
@@ -256,12 +256,6 @@ cmdaddv(struct cmd *cmd, char **xs, size_t n)
cmd->argv[cmd->len] = NULL;
}
-int
-cmdexec(struct cmd c)
-{
- return cmdwait(cmdexeca(c));
-}
-
pid_t
cmdexeca(struct cmd c)
{