You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucy.apache.org by ma...@apache.org on 2011/06/28 06:44:39 UTC
[lucy-commits] svn commit: r1140434 - /incubator/lucy/trunk/core/Lucy/Util/ProcessID.c
Author: marvin
Date: Tue Jun 28 04:44:38 2011
New Revision: 1140434
URL: http://svn.apache.org/viewvc?rev=1140434&view=rev
Log:
LUCY-161 Revert commit r1140432.
Checked in the wrong file.
Modified:
incubator/lucy/trunk/core/Lucy/Util/ProcessID.c
Modified: incubator/lucy/trunk/core/Lucy/Util/ProcessID.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/core/Lucy/Util/ProcessID.c?rev=1140434&r1=1140433&r2=1140434&view=diff
==============================================================================
--- incubator/lucy/trunk/core/Lucy/Util/ProcessID.c (original)
+++ incubator/lucy/trunk/core/Lucy/Util/ProcessID.c Tue Jun 28 04:44:38 2011
@@ -16,8 +16,34 @@
#include "Lucy/Util/ProcessID.h"
+/********************************* UNIXEN *********************************/
+#if (defined(CHY_HAS_UNISTD_H) && defined(CHY_HAS_SIGNAL_H))
+
+#include <sys/types.h>
+#include <unistd.h>
+#include <signal.h>
+#include <errno.h>
+
+int
+lucy_PID_getpid(void) {
+ return getpid();
+}
+
+chy_bool_t
+lucy_PID_active(int pid) {
+ if (kill(pid, 0) == 0) {
+ return true; // signal succeeded, therefore pid active
+ }
+
+ if (errno != ESRCH) {
+ return true; // an error other than "pid not found", thus active
+ }
+
+ return false;
+}
+
/********************************* WINDOWS ********************************/
-#if (defined(CHY_HAS_WINDOWS_H) && defined(CHY_HAS_PROCESS_H) && !defined(__CYGWIN__))
+#elif (defined(CHY_HAS_WINDOWS_H) && defined(CHY_HAS_PROCESS_H))
#include <Windows.h>
#include <process.h>
@@ -47,35 +73,7 @@ lucy_PID_active(int pid) {
return false;
}
-
-/********************************* UNIXEN *********************************/
-#elif (defined(CHY_HAS_UNISTD_H) && defined(CHY_HAS_SIGNAL_H))
-
-#include <sys/types.h>
-#include <unistd.h>
-#include <signal.h>
-#include <errno.h>
-
-int
-lucy_PID_getpid(void) {
- return getpid();
-}
-
-chy_bool_t
-lucy_PID_active(int pid) {
- if (kill(pid, 0) == 0) {
- return true; // signal succeeded, therefore pid active
- }
-
- if (errno != ESRCH) {
- return true; // an error other than "pid not found", thus active
- }
-
- return false;
-}
-
#else
#error "Can't find a known process ID API."
#endif // OS switch.
-