Re: tsrm patch

From: Date: Mon, 09 Jul 2001 04:41:58 +0000
Subject: Re: tsrm patch
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-59246@lists.php.net to get a copy of this message
Shane,

Can you please also have Daniel Beulshausen <daniel@php4win.de> take a look at it as he did the original patch.
Also please try and send unified diffs (cvs diff -u).

Thanks,

Andi

At 03:12 PM 7/8/2001 -0700, Shane Caraveo wrote:
Hi Andi, Here is yet another patch to tsrm. The popen implementation was broken. You could not write to a process because pclose did not wait for a process to end, and the executed process could hang, because both sides of the pipe were inheritable. Index: tsrm_win32.c =================================================================== RCS file: /repository/TSRM/tsrm_win32.c,v retrieving revision 1.4 diff -r1.4 tsrm_win32.c 98a99,106 static HANDLE dupHandle(HANDLE fh, BOOL inherit) {
      HANDLE copy, self = GetCurrentProcess();
      if (!DuplicateHandle(self, fh, self, &copy, 0, inherit, DUPLICATE_SAME_ACCESS|DUPLICATE_CLOSE_SOURCE)) {
              return NULL;
      }
      return copy;
} 129c137,138 < ---
      /* you cannot allow the php end of the pipe to be inheritable, as that will
         cause handles to be leaked, and may cause a spawned process to get stuck! */
130a140
              in = dupHandle(in, FALSE);
133a144
              out = dupHandle(out, FALSE);
173a185,189
      /* pclose is supposed to wait for the process to finish
         This should probabaly be configurable to avoid lockups
      */
      WaitForSingleObject(process->prochnd, INFINITE);
-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe@lists.php.net For additional commands, e-mail: php-dev-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net


Thread (5 messages)

« previous php.dev (#59246) next »