59 |
DWORD result; |
DWORD result; |
60 |
|
|
61 |
ppid = getenv ("EM_PARENT_PROCESS_ID"); |
ppid = getenv ("EM_PARENT_PROCESS_ID"); |
62 |
if (!ppid) |
if (!ppid) |
63 |
{ |
{ |
64 |
printf("no pid.\n"); |
printf("no pid.\n"); |
65 |
return 0; |
return 0; |
66 |
} |
} |
67 |
else |
else |
68 |
{ |
{ |
69 |
getppid_ppid = atoi (ppid); |
getppid_ppid = atoi (ppid); |
70 |
} |
} |
71 |
|
|
72 |
if (!getppid_parent) |
if (!getppid_parent) |
73 |
{ |
{ |
74 |
getppid_parent = OpenProcess (SYNCHRONIZE, FALSE, atoi(ppid)); |
getppid_parent = OpenProcess (SYNCHRONIZE, FALSE, atoi(ppid)); |
75 |
if (!getppid_parent) |
if (!getppid_parent) |
76 |
{ |
{ |
77 |
printf ("Failed to open handle to parent process: %d\n", |
printf ("Failed to open handle to parent process: %d\n", |
78 |
GetLastError()); |
GetLastError()); |
81 |
} |
} |
82 |
|
|
83 |
result = WaitForSingleObject (getppid_parent, 0); |
result = WaitForSingleObject (getppid_parent, 0); |
84 |
switch (result) |
switch (result) |
85 |
{ |
{ |
86 |
case WAIT_TIMEOUT: |
case WAIT_TIMEOUT: |
87 |
/* The parent is still alive. */ |
/* The parent is still alive. */ |
188 |
} |
} |
189 |
|
|
190 |
/* Place a wrapper around the MSVC version of ctime. It returns NULL |
/* Place a wrapper around the MSVC version of ctime. It returns NULL |
191 |
on network directories, so we handle that case here. |
on network directories, so we handle that case here. |
192 |
(Ulrich Leodolter, 1/11/95). */ |
(Ulrich Leodolter, 1/11/95). */ |
193 |
char * |
char * |
194 |
sys_ctime (const time_t *t) |
sys_ctime (const time_t *t) |