Branch: Tag:

2003-03-19

2003-03-19 10:53:26 by 0

Wait for subprocesses to exit before calling rm() on temp files to solve a
problem where the files are left open.

Rev: lib/modules/Search.pmod/Filter.pmod/Base.pike:1.15
Rev: lib/modules/Search.pmod/Filter.pmod/PDF.pmod:1.14
Rev: lib/modules/Search.pmod/Filter.pmod/Word.pmod:1.11

1:   // This file is part of Roxen Search   // Copyright © 2001 Roxen IS. All rights reserved.   // - // $Id: Base.pike,v 1.14 2003/01/20 17:39:14 jonasw Exp $ + // $Id: Base.pike,v 1.15 2003/03/19 10:53:26 jonasw Exp $      //! The MIME content types this class can filter.   constant contenttypes = ({ });
44:   Output filter(Standards.URI uri, string|Stdio.File data,    string content_type, mixed ... more);    - string my_popen(array(string) args, string|void cwd) + string my_popen(array(string) args, string|void cwd, int|void wait_for_exit)    // A smarter version of Process.popen: No need to quote arguments.   {    Stdio.File pipe0 = Stdio.File();
54:    mapping setup = ([ "env":getenv(), "stdout":pipe1 ]);    if (cwd)    setup["cwd"] = cwd; -  Process.create_process(args, setup); +  Process.create_process proc = Process.create_process(args, setup);    pipe1->close();    string result = pipe0->read();    if(!result)    error("my_popen failed with error "+pipe0->errno()+".\n");    pipe0->close(); -  +  if (wait_for_exit) +  proc->wait();    return result;   }