f_print (fout, "closedown(sig)\n\tint sig;\n"); #else f_print (fout, "closedown()\n"); #endif
f_print (fout, "closedown (sig)\n\tint sig;\n");
write_timeout_func (void){  if (!timerflag)    return;  f_print (fout, "\n");  f_print (fout, "static void\n");#ifdef __GNU_LIBRARY__  if (Cflag)    f_print (fout, "closedown(int sig)\n");  else    f_print (fout, "closedown(sig)\n\tint sig;\n");#else  f_print (fout, "closedown()\n");#endif  f_print (fout, "{\n");#ifdef __GNU_LIBRARY__  f_print (fout, "\t(void) signal(sig, %s closedown);\n",	   Cflag ? "(SIG_PF)" : "(void(*)())");#endif  f_print (fout, "\tif (_rpcsvcdirty == 0) {\n");  f_print (fout, "\t\textern fd_set svc_fdset;\n");  f_print (fout, "\t\tstatic int size;\n");  f_print (fout, "\t\tint i, openfd;\n");  if (tirpcflag && pmflag)    {      f_print (fout, "\t\tstruct t_info tinfo;\n\n");      f_print (fout, "\t\tif (!t_getinfo(0, &tinfo) && (tinfo.servtype == T_CLTS))\n");    }  else    {      f_print (fout, "\n\t\tif (_rpcfdtype == SOCK_DGRAM)\n");    }  f_print (fout, "\t\t\texit(0);\n");  f_print (fout, "\t\tif (size == 0) {\n");  if (tirpcflag)    {      f_print (fout, "\t\t\tstruct rlimit rl;\n\n");      f_print (fout, "\t\t\trl.rlim_max = 0;\n");      f_print (fout, "\t\t\tgetrlimit(RLIMIT_NOFILE, &rl);\n");      f_print (fout, "\t\t\tif ((size = rl.rlim_max) == 0)\n");      f_print (fout, "\t\t\t\treturn;\n");    }  else    {      f_print (fout, "\t\t\tsize = getdtablesize();\n");    }  f_print (fout, "\t\t}\n");  f_print (fout, "\t\tfor (i = 0, openfd = 0; i < size && openfd < 2; i++)\n");  f_print (fout, "\t\t\tif (FD_ISSET(i, &svc_fdset))\n");  f_print (fout, "\t\t\t\topenfd++;\n");  f_print (fout, "\t\tif (openfd <= 1)\n");  f_print (fout, "\t\t\texit(0);\n");  f_print (fout, "\t}\n");  f_print (fout, "\t(void) alarm(_RPCSVC_CLOSEDOWN);\n");  f_print (fout, "}\n");}