Mercurial > emacs
comparison lib-src/ntlib.c @ 49600:23a1cea22d13
Trailing whitespace deleted.
| author | Juanma Barranquero <lekktu@gmail.com> |
|---|---|
| date | Tue, 04 Feb 2003 14:56:31 +0000 |
| parents | 1fd32e8a2fad |
| children | 695cf19ef79e d7ddb3e565de |
comparison
equal
deleted
inserted
replaced
| 49599:5ade352e8d1c | 49600:23a1cea22d13 |
|---|---|
| 57 { | 57 { |
| 58 char *ppid; | 58 char *ppid; |
| 59 DWORD result; | 59 DWORD result; |
| 60 | 60 |
| 61 ppid = getenv ("EM_PARENT_PROCESS_ID"); | 61 ppid = getenv ("EM_PARENT_PROCESS_ID"); |
| 62 if (!ppid) | 62 if (!ppid) |
| 63 { | 63 { |
| 64 printf("no pid.\n"); | 64 printf("no pid.\n"); |
| 65 return 0; | 65 return 0; |
| 66 } | 66 } |
| 67 else | 67 else |
| 68 { | 68 { |
| 69 getppid_ppid = atoi (ppid); | 69 getppid_ppid = atoi (ppid); |
| 70 } | 70 } |
| 71 | 71 |
| 72 if (!getppid_parent) | 72 if (!getppid_parent) |
| 73 { | 73 { |
| 74 getppid_parent = OpenProcess (SYNCHRONIZE, FALSE, atoi(ppid)); | 74 getppid_parent = OpenProcess (SYNCHRONIZE, FALSE, atoi(ppid)); |
| 75 if (!getppid_parent) | 75 if (!getppid_parent) |
| 76 { | 76 { |
| 77 printf ("Failed to open handle to parent process: %d\n", | 77 printf ("Failed to open handle to parent process: %d\n", |
| 78 GetLastError()); | 78 GetLastError()); |
| 79 exit (1); | 79 exit (1); |
| 80 } | 80 } |
| 81 } | 81 } |
| 82 | 82 |
| 83 result = WaitForSingleObject (getppid_parent, 0); | 83 result = WaitForSingleObject (getppid_parent, 0); |
| 84 switch (result) | 84 switch (result) |
| 85 { | 85 { |
| 86 case WAIT_TIMEOUT: | 86 case WAIT_TIMEOUT: |
| 87 /* The parent is still alive. */ | 87 /* The parent is still alive. */ |
| 88 return getppid_ppid; | 88 return getppid_ppid; |
| 89 case WAIT_OBJECT_0: | 89 case WAIT_OBJECT_0: |
| 186 { | 186 { |
| 187 return 0; | 187 return 0; |
| 188 } | 188 } |
| 189 | 189 |
| 190 /* Place a wrapper around the MSVC version of ctime. It returns NULL | 190 /* Place a wrapper around the MSVC version of ctime. It returns NULL |
| 191 on network directories, so we handle that case here. | 191 on network directories, so we handle that case here. |
| 192 (Ulrich Leodolter, 1/11/95). */ | 192 (Ulrich Leodolter, 1/11/95). */ |
| 193 char * | 193 char * |
| 194 sys_ctime (const time_t *t) | 194 sys_ctime (const time_t *t) |
| 195 { | 195 { |
| 196 char *str = (char *) ctime (t); | 196 char *str = (char *) ctime (t); |
