diff options
Diffstat (limited to 'src/exec.c')
| -rw-r--r-- | src/exec.c | 29 |
1 files changed, 15 insertions, 14 deletions
@@ -167,7 +167,7 @@ static long long tv_diff(struct timeval a, struct timeval b) { * @brief Print one line of `time` output. * @param label "real", "user" or "sys". * @param us The time in microseconds. - * @param posix `-p`: seconds with two decimals; else `0m0.000s`. + * @param posix `-p`: seconds with two decimals. Else `0m0.000s`. */ static void put_time(const char *label, long long us, bool posix) { if (us < 0) @@ -195,7 +195,7 @@ static void put_time(const char *label, long long us, bool posix) { * `-p` the three POSIX lines are printed and nothing else. * * @param n The N_TIME node. - * @param flags Evaluation flags for the pipeline; `EV_EXIT` is dropped + * @param flags Evaluation flags for the pipeline. `EV_EXIT` is dropped * because the shell must survive to print the report. * @return Status of the pipeline (0 if there is none). */ @@ -436,7 +436,7 @@ static void func_unref(func *fn) { * @brief Define (or redefine) a function. * @param name Its name. * @param body Its body. - * @param owner Arena that owns the body; a reference is taken. + * @param owner Arena that owns the body. A reference is taken. */ void func_define(const char *name, node *body, arena *owner) { cmdent *e = cmd_lookup(name, true); @@ -805,7 +805,7 @@ static void simple_prep(node *n, simple_cmd *sc) { /** * @brief simple_prep() on behalf of a child: an expansion error is the child's * failure, not the shell's. - * @return false if expansion failed; `$?` holds the status. + * @return false if expansion failed. `$?` holds the status. */ static bool guarded_prep(node *n, simple_cmd *sc) { jmploc jl; @@ -871,7 +871,7 @@ static void assign_temp(const simple_cmd *sc) { * @param out Descriptor for its stdout, or -1. * @param async When not NULL, receives the pid and the command is not * waited for (pipeline stages, `&`, command substitution). - * @return The exit status; 0 for an async launch. + * @return The exit status. 0 for an async launch. */ /** * @brief Apply `_TAG_REDIR_*` assignments given on an external command. @@ -1024,7 +1024,7 @@ static int run_special_guarded(const builtin *bi, simple_cmd *sc) { /** * @brief Run a builtin with its assignments and redirections. * - * Assignments before a special builtin persist; before a regular builtin + * Assignments before a special builtin persist. Before a regular builtin * they last only for the call. */ static int run_builtin(simple_cmd *sc) { @@ -1064,7 +1064,7 @@ static int run_builtin(simple_cmd *sc) { * @brief Call a shell function. * @param fn The function. * @param argc Argument count, including the name. - * @param argv Arguments; argv[0] is the name. + * @param argv Arguments. Argv[0] is the name. * @param flags EV_TESTED if the status is being tested. * @return The function's exit status. */ @@ -1300,7 +1300,7 @@ static void launch_stage(stage *st, int nc, int i, node *c) { * the pipe. If the reader is this shell (the last stage, or another * deferred stage) nobody would drain the pipe while we write, so the * output is collected in memory first: up to PIPE_BUF bytes are certain - * to fit in an empty pipe and cost no process at all; anything larger is + * to fit in an empty pipe and cost no process at all. Anything larger is * handed to a forked writer. * * @param st The stages. @@ -1350,7 +1350,7 @@ static void read_all(int fd, strbuf *sb); * @param st The stages. * @param nc Number of commands. * @param total Number of stage slots (one more when capturing). - * @param jb The job, under job control; else NULL. + * @param jb The job, under job control. Else NULL. * @return Status of the last command, or with `pipefail` of the last one * that failed. */ @@ -1516,7 +1516,7 @@ static int eval_pipe(node *n, unsigned flags, strbuf *cap) { /** * @brief Run a command in the background (`command &`). * - * An external command is spawned; anything else is forked. Without job + * An external command is spawned. Anything else is forked. Without job * control the child ignores SIGINT and SIGQUIT and reads /dev/null. */ static int eval_background(node *body) { @@ -1633,8 +1633,8 @@ static int cmdsub_fork(node *n, simple_cmd *sc, strbuf *sb) { * @brief Pick the cheapest way to run a command substitution and collect its * output. * - * `$(<file)` is read directly; a pure builtin runs in the shell; an - * external command is spawned; a pipeline spawns its stages; only the + * `$(<file)` is read directly. A pure builtin runs in the shell. An + * external command is spawned. A pipeline spawns its stages. Only the * rest forks. */ static int cmdsub_collect(node *n, strbuf *sb) { @@ -1980,7 +1980,8 @@ int run_input(unsigned flags) { jmploc *prev = exc_handler; unwind u; int saved_loop = loop_depth; - bool recover = ((flags & RI_TOP) && opt.interactive) || (flags & RI_RECOVER); + bool recover = + ((flags & RI_TOP) && opt.interactive) || (flags & RI_RECOVER); unwind_save(&u); if (stack_low()) { @@ -1990,7 +1991,7 @@ int run_input(unsigned flags) { if (!recover) { /* * An error or exit unwinding through here drops this level's - * parse arena; without this it leaks once per error that an + * parse arena. Without this it leaks once per error that an * outer handler (command, a subshell, the prompt) catches. * One setjmp() per eval, `.` or script, not per command. */ |
