X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=ioncore%2Fexec.c;h=bd43fe862c39e428451e037aa8de4d7e5a5beeda;hb=3102bb90c325d9b29ac304d8f3ea0a17df564fc8;hp=97f33b3068401f616a1d65bf4bf3dd08a9bc59d3;hpb=dd31dc3ce15f1c3b1db2ac464f0c5ea04836911a;p=ion3.git diff --git a/ioncore/exec.c b/ioncore/exec.c index 97f33b3..bd43fe8 100644 --- a/ioncore/exec.c +++ b/ioncore/exec.c @@ -1,7 +1,7 @@ /* * ion/ioncore/exec.c * - * Copyright (c) Tuomo Valkonen 1999-2007. + * Copyright (c) Tuomo Valkonen 1999-2008. * * See the included file LICENSE for details. */ @@ -123,7 +123,8 @@ int ioncore_exec(const char *cmd) /*EXTL_DOC - * Run \var{cmd} with a read pipe connected to its stdout and stderr. + * Run \var{cmd} in directory \var{wd} with a read pipe connected to its + * stdout and stderr. * When data is received through one of these pipes, \var{h} or \var{errh} * is called with that data. When the pipe is closed, the handler is called * with \code{nil} argument. The PID of the new process is returned, or @@ -131,12 +132,13 @@ int ioncore_exec(const char *cmd) */ EXTL_SAFE EXTL_EXPORT -int ioncore_popen_bgread(const char *cmd, ExtlFn h, ExtlFn errh) +int ioncore_popen_bgread(const char *cmd, ExtlFn h, ExtlFn errh, + const char *wd) { WExecP p; p.target=NULL; - p.wd=NULL; + p.wd=wd; p.cmd=cmd; return mainloop_popen_bgread(cmd, setup_exec, (void*)&p, h, errh);