[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r22638 - gnunet/src/util
From: |
gnunet |
Subject: |
[GNUnet-SVN] r22638 - gnunet/src/util |
Date: |
Fri, 13 Jul 2012 18:24:41 +0200 |
Author: LRN
Date: 2012-07-13 18:24:41 +0200 (Fri, 13 Jul 2012)
New Revision: 22638
Modified:
gnunet/src/util/os_priority.c
Log:
W32: correct handling of crazy W32 process quirks
Modified: gnunet/src/util/os_priority.c
===================================================================
--- gnunet/src/util/os_priority.c 2012-07-13 16:24:38 UTC (rev 22637)
+++ gnunet/src/util/os_priority.c 2012-07-13 16:24:41 UTC (rev 22638)
@@ -464,12 +464,27 @@
if (0 == SafeTerminateProcess (proc->handle, 0, 0))
{
DWORD error_code = GetLastError ();
- if (error_code != WAIT_TIMEOUT) /* OK, since timeout is 0 */
+ if ((error_code != WAIT_TIMEOUT) && (error_code !=
ERROR_PROCESS_ABORTED))
{
- LOG (GNUNET_ERROR_TYPE_WARNING,
+ LOG ((error_code == ERROR_ACCESS_DENIED) ?
+ GNUNET_ERROR_TYPE_INFO : GNUNET_ERROR_TYPE_WARNING,
"SafeTermiateProcess failed with code %lu\n", error_code);
- SetErrnoFromWinError (error_code);
- return -1;
+ /* The problem here is that a process that is already dying
+ * might cause SafeTerminateProcess to fail with
+ * ERROR_ACCESS_DENIED, but the process WILL die eventually.
+ * If we really had a permissions problem, hanging up (which
+ * is what will happen in process_wait() in that case) is
+ * a valid option.
+ */
+ if (error_code == ERROR_ACCESS_DENIED)
+ {
+ errno = 0;
+ }
+ else
+ {
+ SetErrnoFromWinError (error_code);
+ return -1;
+ }
}
}
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r22638 - gnunet/src/util,
gnunet <=