pike.git / lib / modules / Process.pmod

version» Context lines:

pike.git/lib/modules/Process.pmod:1:   #pike __REAL_VERSION__    - #define error(X) throw( ({ (X), backtrace()[0..sizeof(backtrace())-2] }) ) -  +    import Stdio;      #if !constant(strerror)   #define strerror(X) ("errno="+X)   #endif      constant create_process = __builtin.create_process;      class Process   {
pike.git/lib/modules/Process.pmod:265: Inside #if undefined(__NT__) and #if constant(fork)
      pie=Stdio.File();    pied=pie->pipe();       if(!(pid=fork()))    {    mixed err=catch    {    if(cwd && !cd(cwd))    { -  throw(({"pike: cannot change cwd to "+cwd+ -  ": "+strerror(errno())+"\n", -  backtrace()})); +  error( "pike: cannot change cwd to "+cwd+ +  ": "+strerror(errno())+"\n" );    }       if (sizeof(fdp)>0 && fdp[0]) fdp[0]->dup2(Stdio.File("stdin"));    if (sizeof(fdp)>1 && fdp[1]) fdp[1]->dup2(Stdio.File("stdout"));    if (sizeof(fdp)>2 && fdp[2]) fdp[2]->dup2(Stdio.File("stderr"));    /* dup2 fdd[3..] here FIXME FIXME */    foreach (fd_to_close,object f)    if (objectp(f)) { f->close(); destruct(f); }    pie->close();    destruct(pie);       pied->set_close_on_exec(1);       if (env)    exece(cmd,args||({}),env);    else    exece(cmd,args||({}));    -  throw(({"pike: failed to exece "+cmd+ -  ": "+strerror(errno())+"\n", -  backtrace()})); +  error( "pike: failed to exece "+cmd+ +  ": "+strerror(errno())+"\n" );    };       pied->write(encode_value(err));    exit(1);    }       foreach (fdp,object f) if (objectp(f)) { f->close(); destruct(f); }       pied->close();    destruct(pied);