8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-23 22:03:03 +01:00

Added check for failed fork() system call

This commit is contained in:
alexpeshkoff 2015-06-01 13:59:25 +00:00
parent 90ddf8e40f
commit c77afd9583

View File

@ -1076,10 +1076,23 @@ rem_port* INET_connect(const TEXT* name,
}
return NULL;
}
#ifdef WIN_NT
if (flag & SRVR_debug)
#else
if ((flag & SRVR_debug) || !fork())
int pid = 0;
if (!(flag & SRVR_debug))
{
pid = fork();
if (pid < 0)
{
inet_error(port, "fork", isc_net_connect_err, inetErrNo);
disconnect(port);
return NULL;
}
}
if (!pid)
#endif
{
SOCLOSE(port->port_handle);