summaryrefslogtreecommitdiffstats
path: root/job.c
AgeCommit message (Collapse)Author
2015-10-31Merge branch 'obsd-master'Thomas Adam
2015-10-31Because pledge(2) does not allow us to pass directory file descriptorsnicm
around, we can't use file descriptors for the working directory because we will be unable to pass it to a privileged process to tell it where to read or write files or spawn children. So move tmux back to using strings for the current working directory. We try to check it exists with access() when it is set but ultimately fall back to ~ if it fails at time of use (or / if that fails too).
2015-10-28Merge branch 'obsd-master'Thomas Adam
2015-10-28Like options, move the environ struct into environ.c.nicm
2015-10-15Some header fixes.Nicholas Marriott
2015-06-17Merge branch 'obsd-master'Thomas Adam
2015-06-17Use an explicit job state instead of avoid closing our side of thenicm
socketpair and setting it to -1 to mark when the other side is closed. This avoids closing it while the libevent bufferevent still has it (it could try to add it to the polled set which some mechanisms don't like). Fixes part a problem reported by Bruno Sutic.
2015-04-25Merge branch 'obsd-master'Thomas Adam
2015-04-24Set working directory for run-shell and if-shell.nicm
2014-11-08No need for $Id$ now.Nicholas Marriott
2014-10-21Merge branch 'obsd-master'Thomas Adam
Conflicts: Makefile cmd-list-commands.c cmd-suspend-client.c job.c tmux.h xmalloc.c
2014-10-20Tidy up some includes.nicm
2014-04-23Merge branch 'obsd-master'Thomas Adam
Conflicts: Makefile tmux.1 window.c
2014-04-14Don't leak socketpair file descriptors if fork fails. Spotted by Balazsnicm
Kezes.
2013-10-10Use format_get_command() and some spacing tweaks.nicm
2013-10-10Add openat() to compat.Nicholas Marriott
2013-04-23Merge branch 'obsd-master'Thomas Adam
Sync from OpenBSD.
2013-04-17%zu format for size_t.Nicholas Marriott
2013-04-13Merge branch 'obsd-master'Thomas Adam
Conflicts: tmux.c
2013-04-10Set EV_WRITE for jobs or run/if-shell jobs can hang. From Chris Johnsen.Nicholas Marriott
2013-03-25Extend jobs to support writing and use that for copy-pipe instead ofNicholas Marriott
popen, from Chris Johnsen.
2013-03-22No more lint means no more ARGSUSED.Nicholas Marriott
2013-03-21Extend jobs to support writing and use that for copy-pipe instead of popen,Nicholas Marriott
from Chris Johnsen.
2013-02-17No more lint means no more ARGSUSED.Nicholas Marriott
2012-07-11Sync OpenBSD patchset 1150:Tiago Cunha
xfree is not particularly helpful, remove it. From Thomas Adam.
2012-07-10xfree is not particularly helpful, remove it. From Thomas Adam.Nicholas Marriott
2012-01-29Sync OpenBSD patchset 1014:Tiago Cunha
Call bufferevent_free before closing file descriptor associated with it or bugs in $EventMechanism on $OtherOS makes libevent get it's knickers in a twist. From Dylan Alex Simon.
2012-01-29Call bufferevent_free before closing file descriptor associated with itNicholas Marriott
or bugs in $EventMechanism on $OtherOS makes libevent get it's knickers in a twist. From Dylan Alex Simon.
2011-07-09Expand the Id keyword. Tiago Cunha
2011-02-15Sync OpenBSD patchset 855:Tiago Cunha
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).
2011-02-15Sync OpenBSD patchset 854:Tiago Cunha
Use LIST_* not SLIST_*.
2011-02-14Sync OpenBSD patchset 848:Tiago Cunha
Set $TMUX without the session when background jobs are run.
2011-01-26Simplify the way jobs work and drop the persist type, so all jobs areNicholas Marriott
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).
2011-01-26Use LIST_* not SLIST_*.Nicholas Marriott
2011-01-23Set $TMUX without the session when background jobs are run.Nicholas Marriott
2011-01-21Sync OpenBSD patchset 834:Tiago Cunha
Move all calls to fcntl(...O_NONBLOCK) into a function and clear the flag on the stdio file descriptors before closing them (fixes things like "tmux ls && cat").
2011-01-08Move all calls to fcntl(...O_NONBLOCK) into a function and clear theNicholas Marriott
flag on the stdio file descriptors before closing them (fixes things like "tmux ls && cat").
2010-10-24Sync OpenBSD patchset 775:Tiago Cunha
Trying to set FD_CLOEXEC on every fd is a lost cause, just use closefrom() before exec.
2010-10-16Trying to set FD_CLOEXEC on every fd is a lost cause, just useNicholas Marriott
closefrom() before exec.
2010-08-29Sync OpenBSD patchset 751:Tiago Cunha
Do not call event_del() for signals after fork(), just use sigaction() directly instead - calling libevent functions after fork() w/o event_reinit() is a bad idea, even if in this case it was harmless.
2010-08-19Do not call event_del() for signals after fork(), just use sigaction()Nicholas Marriott
directly instead - calling libevent functions after fork() w/o event_reinit() is a bad idea, even if in this case it was harmless.
2010-05-14Sync OpenBSD patchset 696:Tiago Cunha
Make signal handler setup/teardown two common functions instead of six, and reset SIGCHLD after fork to fix problems with some shells. From Romain Francoise.
2010-05-04Put this back in with the initialisation in the right order.Nicholas Marriott
2010-05-04Revert last change, it appears to be broken somehow.Nicholas Marriott
2010-05-03Make signal handler setup/teardown two common functions instead of six,Nicholas Marriott
and reset SIGCHLD after fork to fix problems with some shells. From Romain Francois.
2010-04-06Run job commands explicitly in the global enviroment (which can beNicholas Marriott
modified with setenv -g) rather than with the environment tmux started with.
2010-04-04Run job commands explicitly in the global enviroment (which can beNicholas Marriott
modified with setenv -g) rather than with the environment tmux started with.
2010-02-26Sync OpenBSD patchset 655:Tiago Cunha
Typo fix from Tim van der Molen.
2010-02-24Typo fix from Tim van der Molen.Nicholas Marriott
2009-12-04Sync OpenBSD patchset 581:Tiago Cunha
Massive spaces->tabs and trailing whitespace cleanup, hopefully for the last time now I've configured emacs to make them displayed in really annoying colours...