diff options
author | Nicholas Marriott <nicm@openbsd.org> | 2011-01-26 01:54:56 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@openbsd.org> | 2011-01-26 01:54:56 +0000 |
commit | db7a89b1ee4c11006cdf607465b6c0fc13333fd1 (patch) | |
tree | 5a6f12be811cd9f6ca649d23fcd4a482c5458b09 /cmd-server-info.c | |
parent | 4dfb29fa38a22615eda253b1124261379f6fbbcc (diff) |
Simplify the way jobs work and drop the persist type, so all jobs are
fire-and-forget.
Status jobs now managed with two trees of output (new and old), rather
than storing the output in the jobs themselves. When the status line is
processed any jobs which don't appear in the new tree are started and
the output from the old tree displayed. When a job finishes it updates
the new tree with its output and that is used for any subsequent
redraws. When the status interval expires, the new tree is moved to the
old so that all jobs are run again.
This fixes the "#(echo %H:%M:%S)" problem which would lead to thousands
of identical persistent jobs and high memory use (this can still be
achieved by adding "sleep 30" but that is much less likely to happen by
accident).
Diffstat (limited to 'cmd-server-info.c')
-rw-r--r-- | cmd-server-info.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/cmd-server-info.c b/cmd-server-info.c index 5e95757d..3edb9d2b 100644 --- a/cmd-server-info.c +++ b/cmd-server-info.c @@ -175,8 +175,8 @@ cmd_server_info_exec(unused struct cmd *self, struct cmd_ctx *ctx) ctx->print(ctx, "Jobs:"); LIST_FOREACH(job, &all_jobs, lentry) { - ctx->print(ctx, "%s [fd=%d, pid=%d, status=%d, flags=0x%x]", - job->cmd, job->fd, job->pid, job->status, job->flags); + ctx->print(ctx, "%s [fd=%d, pid=%d, status=%d]", + job->cmd, job->fd, job->pid, job->status); } return (0); |