File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -80,7 +80,7 @@ cupsdAcceptClient(cupsd_listener_t *lis)/* I - Listener socket */
8080 * Make sure we don't have a full set of clients already...
8181 */
8282
83- if (cupsArrayCount (Clients ) = = MaxClients )
83+ if (MaxClients > 0 && cupsArrayCount (Clients ) > = MaxClients )
8484 return ;
8585
8686 cupsdSetBusyState (1 );
Original file line number Diff line number Diff line change @@ -523,13 +523,14 @@ main(int argc, /* I - Number of command-line args */
523523 * to the number of TCP port number values (64k-1)...
524524 */
525525
526+ limit .rlim_max = 0 ;
526527 getrlimit (RLIMIT_NOFILE , & limit );
527528
528529#if !defined(HAVE_POLL ) && !defined(HAVE_EPOLL ) && !defined(HAVE_KQUEUE )
529- if ((MaxFDs = limit .rlim_max ) > FD_SETSIZE )
530+ if ((MaxFDs = limit .rlim_max ) > FD_SETSIZE || MaxFDs <= 0 )
530531 MaxFDs = FD_SETSIZE ;
531532#else
532- if ((MaxFDs = limit .rlim_max ) > 65535 )
533+ if ((MaxFDs = limit .rlim_max ) > 65535 || MaxFDs <= 0 )
533534 MaxFDs = 65535 ;
534535#endif /* RLIM_INFINITY */
535536
You can’t perform that action at this time.
0 commit comments