aboutsummaryrefslogtreecommitdiffstats
path: root/src/w32proc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/w32proc.c')
-rw-r--r--src/w32proc.c37
1 files changed, 30 insertions, 7 deletions
diff --git a/src/w32proc.c b/src/w32proc.c
index 33aed5eb8e3..b9239cbb99a 100644
--- a/src/w32proc.c
+++ b/src/w32proc.c
@@ -103,6 +103,29 @@ sys_signal (int sig, signal_handler handler)
103 return old; 103 return old;
104} 104}
105 105
106/* Emulate sigaction. */
107int
108sigaction (int sig, const struct sigaction *act, struct sigaction *oact)
109{
110 signal_handler old;
111
112 if (sig != SIGCHLD)
113 {
114 errno = EINVAL;
115 return -1;
116 }
117 old = sig_handlers[sig];
118 if (act)
119 sig_handlers[sig] = act->sa_handler;
120 if (oact)
121 {
122 oact->sa_handler = old;
123 oact->sa_flags = 0;
124 oact->sa_mask = empty_mask;
125 }
126 return 0;
127}
128
106/* Defined in <process.h> which conflicts with the local copy */ 129/* Defined in <process.h> which conflicts with the local copy */
107#define _P_NOWAIT 1 130#define _P_NOWAIT 1
108 131
@@ -176,7 +199,7 @@ delete_child (child_process *cp)
176 /* Should not be deleting a child that is still needed. */ 199 /* Should not be deleting a child that is still needed. */
177 for (i = 0; i < MAXDESC; i++) 200 for (i = 0; i < MAXDESC; i++)
178 if (fd_info[i].cp == cp) 201 if (fd_info[i].cp == cp)
179 abort (); 202 emacs_abort ();
180 203
181 if (!CHILD_ACTIVE (cp)) 204 if (!CHILD_ACTIVE (cp))
182 return; 205 return;
@@ -316,7 +339,7 @@ create_child (char *exe, char *cmdline, char *env, int is_gui_app,
316 DWORD flags; 339 DWORD flags;
317 char dir[ MAXPATHLEN ]; 340 char dir[ MAXPATHLEN ];
318 341
319 if (cp == NULL) abort (); 342 if (cp == NULL) emacs_abort ();
320 343
321 memset (&start, 0, sizeof (start)); 344 memset (&start, 0, sizeof (start));
322 start.cb = sizeof (start); 345 start.cb = sizeof (start);
@@ -405,7 +428,7 @@ register_child (int pid, int fd)
405 if (fd_info[fd].cp != NULL) 428 if (fd_info[fd].cp != NULL)
406 { 429 {
407 DebPrint (("register_child: fd_info[%d] apparently in use!\n", fd)); 430 DebPrint (("register_child: fd_info[%d] apparently in use!\n", fd));
408 abort (); 431 emacs_abort ();
409 } 432 }
410 433
411 fd_info[fd].cp = cp; 434 fd_info[fd].cp = cp;
@@ -459,7 +482,7 @@ sys_wait (int *status)
459 /* We want to wait for a specific child */ 482 /* We want to wait for a specific child */
460 wait_hnd[nh] = dead_child->procinfo.hProcess; 483 wait_hnd[nh] = dead_child->procinfo.hProcess;
461 cps[nh] = dead_child; 484 cps[nh] = dead_child;
462 if (!wait_hnd[nh]) abort (); 485 if (!wait_hnd[nh]) emacs_abort ();
463 nh++; 486 nh++;
464 active = 0; 487 active = 0;
465 goto get_result; 488 goto get_result;
@@ -507,7 +530,7 @@ sys_wait (int *status)
507 active -= WAIT_ABANDONED_0; 530 active -= WAIT_ABANDONED_0;
508 } 531 }
509 else 532 else
510 abort (); 533 emacs_abort ();
511 534
512get_result: 535get_result:
513 if (!GetExitCodeProcess (wait_hnd[active], &retval)) 536 if (!GetExitCodeProcess (wait_hnd[active], &retval))
@@ -1189,7 +1212,7 @@ sys_select (int nfds, SELECT_TYPE *rfds, SELECT_TYPE *wfds, SELECT_TYPE *efds,
1189#endif 1212#endif
1190 wait_hnd[nh] = cp->char_avail; 1213 wait_hnd[nh] = cp->char_avail;
1191 fdindex[nh] = i; 1214 fdindex[nh] = i;
1192 if (!wait_hnd[nh]) abort (); 1215 if (!wait_hnd[nh]) emacs_abort ();
1193 nh++; 1216 nh++;
1194#ifdef FULL_DEBUG 1217#ifdef FULL_DEBUG
1195 DebPrint (("select waiting on child %d fd %d\n", 1218 DebPrint (("select waiting on child %d fd %d\n",
@@ -1276,7 +1299,7 @@ count_children:
1276 active -= WAIT_ABANDONED_0; 1299 active -= WAIT_ABANDONED_0;
1277 } 1300 }
1278 else 1301 else
1279 abort (); 1302 emacs_abort ();
1280 1303
1281 /* Loop over all handles after active (now officially documented as 1304 /* Loop over all handles after active (now officially documented as
1282 being the first signaled handle in the array). We do this to 1305 being the first signaled handle in the array). We do this to