g_do_signals(); /* set up signal handling */
incoming = create_listening_connection(service);
- if (incoming == NULL)
+ if (incoming == NULL || connection_status(incoming) != CON_UP)
GDB_GIVEUP("create_forking_server: can't create listening connection")
/*----------------------------------------------------------*/
gdb_sockaddr_of_client, &gdb_socklen,
&gdb_client_tuple);
if(complete_operation(listenop) != OP_COMPLETE ||
- client == NULL)
- GDB_GIVEUP("create_forking_server: failed to accept client")
+ client == NULL) {
+ gdb_perror("GDB create_forking_server: failed to accept client");
+ reset_operation(listenop);
+ (void) sever_connection(client);
+ continue;
+ }
/*
/* Called on SIGCHILD to reap all dead children.
/*
/************************************************************************/
+#ifndef sun
int
+#else
+void
+#endif
gdb_reaper()
{
union wait status;
int
g_do_signals()
{
- (void) signal(SIGCHLD, gdb_reaper);
+#ifdef sun
+ struct sigvec act;
+
+ act.sv_handler = gdb_reaper;
+ act.sv_mask = 0;
+ act.sv_flags = 0;
+ (void) sigvec(SIGCHLD, &act, NULL);
+#else /* sun */
+ (void) signal(SIGCHLD, gdb_reaper);
+#endif
}