void RshWatcher(int ninvoke,int port){ /* echo dynamically allocated PORT number */ /* fprintf(stdout,"%d\n",port); */ /* if( foreground ) */ if( ninvoke == 0 ){ CStr(host,MaxHostNameLen); getpeerNAME(0,AVStr(host)); proc_title("delegated/rsh/%s",host); if( Fork("RshWatcher") == 0 ){ serverControl(stdin,stdout); _Finish(0); } }else{ fprintf(stderr,"\r\nRESTARTED\r\n> "); fflush(stderr); } /* fclose(stdin); fclose(stdout); fclose(stderr); */ }
void config_process(enum smtp_proc_type proc) { struct rlimit rl; smtpd_process = proc; setproctitle("%s", proc_title(proc)); if (getrlimit(RLIMIT_NOFILE, &rl) == -1) fatal("fdlimit: getrlimit"); rl.rlim_cur = rl.rlim_max; if (setrlimit(RLIMIT_NOFILE, &rl) == -1) fatal("fdlimit: setrlimit"); }