make sure our inetd fd > 2 - (code)

This commit is contained in:
Radim Kolar 2020-06-05 20:00:02 +02:00
parent ddd30f921f
commit 0cc86455da

View File

@ -349,8 +349,11 @@ int main (int argc, char ** argv)
/* inetd init */ /* inetd init */
if(inetd_mode) { if(inetd_mode) {
/* make sure that out descriptor is not 0-2, we closing these */
for( opt=dup(0);opt>-1 && opt<=2; ) {
opt=dup(0); opt=dup(0);
} }
}
if(daemonize || inetd_mode) if(daemonize || inetd_mode)
{ {