Print this page
rpcgen should only produce ANSI code

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/rpcgen/rpc_svcout.c
          +++ new/usr/src/cmd/rpcgen/rpc_svcout.c
↓ open down ↓ 12 lines elided ↑ open up ↑
  13   13   * When distributing Covered Code, include this CDDL HEADER in each
  14   14   * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  
  22   22  /*
       23 + * Copyright 2014 Garrett D'Amore <garrett@damore.org>
       24 + *
  23   25   * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  24   26   * Use is subject to license terms.
  25   27   */
  26   28  /* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
  27   29  /* All Rights Reserved */
  28   30  /*
  29   31   * University Copyright- Copyright (c) 1982, 1986, 1988
  30   32   * The Regents of the University of California
  31   33   * All Rights Reserved
  32   34   *
↓ open down ↓ 35 lines elided ↑ open up ↑
  68   70  static void print_err_message(const char *, const char *, ...);
  69   71  static void write_msg_out(void);
  70   72  static void write_timeout_func(void);
  71   73  static void write_pm_most(char *, int);
  72   74  static void write_rpc_svc_fg(char *, char *);
  73   75  static void open_log_file(char *, char *);
  74   76  
  75   77  static void
  76   78  p_xdrfunc(char *rname, char *typename)
  77   79  {
  78      -        if (Cflag) {
  79      -                f_print(fout, "\t\t_xdr_%s = (xdrproc_t)\n", rname);
  80      -                f_print(fout, "\t\t    xdr_%s;\n", stringfix(typename));
  81      -        } else {
  82      -                f_print(fout, "\t\t_xdr_%s = xdr_%s;\n",
  83      -                    rname, stringfix(typename));
  84      -        }
       80 +        f_print(fout, "\t\t_xdr_%s = (xdrproc_t)\n", rname);
       81 +        f_print(fout, "\t\t    xdr_%s;\n", stringfix(typename));
  85   82  }
  86   83  
  87   84  static void
  88   85  internal_proctype(proc_list *plist)
  89   86  {
  90   87          f_print(fout, "static ");
  91   88          ptype(plist->res_prefix, plist->res_type, 1);
  92   89          f_print(fout, "*");
  93   90  }
  94   91  
↓ open down ↓ 198 lines elided ↑ open up ↑
 293  290                                  f_print(fout,
 294  291  "\t\tif (thr_create(NULL, 0, closedown, NULL, 0, NULL) != 0) {\n");
 295  292                                  print_err_message("\t\t\t",
 296  293                                      "cannot create closedown thread");
 297  294                                  f_print(fout, "\t\t\texit(1);\n");
 298  295                                  f_print(fout, "\t\t}\n");
 299  296                                  f_print(fout, "\t}\n");
 300  297                          } else {
 301  298                                  f_print(fout,
 302  299                                  "\t\t(void) signal(SIGALRM, %s closedown);\n",
 303      -                                    Cflag? "(SIG_PF)":"(void(*)())");
      300 +                                    "(SIG_PF)");
 304  301                                  f_print(fout,
 305  302  "\t\t(void) alarm(_RPCSVC_CLOSEDOWN/2);\n");
 306  303                                  f_print(fout, "\t}\n");
 307  304                          }
 308  305                  }
 309  306          }
 310  307          f_print(fout, "\tsvc_run();\n");
 311  308          print_err_message("\t", "svc_run returned");
 312  309          f_print(fout, "\texit(1);\n");
 313  310          f_print(fout, "\t/* NOTREACHED */\n");
↓ open down ↓ 46 lines elided ↑ open up ↑
 360  357                          if (proc->arg_num < 2 &&
 361  358                              streq(proc->args.decls->decl.type, "void")) {
 362  359                                  f_print(fout, "/* ARGSUSED */\n");
 363  360                          }
 364  361                          if (!mtflag)
 365  362                                  internal_proctype(proc);
 366  363                          else
 367  364                                  f_print(fout, "int");
 368  365                          f_print(fout, "\n_");
 369  366                          pvname(proc->proc_name, vp->vers_num);
 370      -                        if (Cflag) {
 371      -                                f_print(fout, "(\n");
 372      -                                f_print(fout, "    ");
 373      -                                /* arg name */
 374      -                                if (proc->arg_num > 1)
 375      -                                        /* LINTED variable format */
 376      -                                        f_print(fout, proc->args.argname);
 377      -                                else
 378      -                                        ptype(proc->args.decls->decl.prefix,
 379      -                                            proc->args.decls->decl.type, 0);
 380      -                                f_print(fout, " *argp,\n");
 381      -                                if (mtflag) {
 382      -                                        f_print(fout, "    ");
 383      -                                        ptype(proc->res_prefix,
 384      -                                            proc->res_type, 1);
 385      -                                        f_print(fout, "*%s,\n", RESULT);
 386      -                                }
 387      -                                f_print(fout, "    struct svc_req *%s)\n",
 388      -                                    RQSTP);
 389  367  
 390      -                        } else {
 391      -                                if (mtflag)
 392      -                                        f_print(fout, "(argp, %s, %s)\n",
 393      -                                            RESULT, RQSTP);
 394      -                                else
 395      -                                        f_print(fout, "(argp, %s)\n", RQSTP);
 396      -                                /* arg name */
 397      -                                if (proc->arg_num > 1)
 398      -                                        f_print(fout, "\t%s *argp;\n",
 399      -                                            proc->args.argname);
 400      -                                else {
 401      -                                        f_print(fout, "\t");
 402      -                                        ptype(proc->args.decls->decl.prefix,
 403      -                                            proc->args.decls->decl.type, 0);
 404      -                                        f_print(fout, " *argp;\n");
 405      -                                }
 406      -                                if (mtflag)
 407      -                                        f_print(fout, "\tvoid *%s;\n", RESULT);
 408      -                                f_print(fout, "\tstruct svc_req *%s;\n", RQSTP);
      368 +                        f_print(fout, "(\n");
      369 +                        f_print(fout, "    ");
      370 +                        /* arg name */
      371 +                        if (proc->arg_num > 1)
      372 +                                /* LINTED variable format */
      373 +                                f_print(fout, proc->args.argname);
      374 +                        else
      375 +                                ptype(proc->args.decls->decl.prefix,
      376 +                                    proc->args.decls->decl.type, 0);
      377 +                        f_print(fout, " *argp,\n");
      378 +                        if (mtflag) {
      379 +                                f_print(fout, "    ");
      380 +                                ptype(proc->res_prefix, proc->res_type, 1);
      381 +                                f_print(fout, "*%s,\n", RESULT);
 409  382                          }
      383 +                        f_print(fout, "    struct svc_req *%s)\n", RQSTP);
 410  384  
 411  385                          f_print(fout, "{\n");
 412  386                          f_print(fout, "\treturn (");
 413  387                          /* for mtflag, arguments are different */
 414      -                        if (Cflag || mtflag)
 415      -                                pvname_svc(proc->proc_name, vp->vers_num);
 416      -                        else
 417      -                                pvname(proc->proc_name, vp->vers_num);
      388 +                        pvname_svc(proc->proc_name, vp->vers_num);
 418  389                          f_print(fout, "(");
 419  390                          if (proc->arg_num < 2) { /* single argument */
 420  391                                  /* only print if non-void */
 421  392                                  if (!streq(proc->args.decls->decl.type, "void"))
 422  393                                          f_print(fout, "*argp, ");
 423  394                          } else {
 424  395                                  f_print(fout, "\n");
 425  396                                  for (l = proc->args.decls;  l != NULL;
 426  397                                      l = l->next)
 427  398                                          f_print(fout, "\t    argp->%s,\n",
↓ open down ↓ 15 lines elided ↑ open up ↑
 443  414          int filled;
 444  415  
 445  416          for (vp = def->def.pr.versions; vp != NULL; vp = vp->next) {
 446  417                  f_print(fout, "\n");
 447  418                  if (storage != NULL) {
 448  419                          f_print(fout, "%s ", storage);
 449  420                  }
 450  421                  f_print(fout, "void\n");
 451  422                  pvname(def->def_name, vp->vers_num);
 452  423  
 453      -                if (Cflag) {
 454      -                        f_print(fout, "(struct svc_req *%s, ", RQSTP);
 455      -                        f_print(fout, "register SVCXPRT *%s)\n", TRANSP);
 456      -                } else {
 457      -                        f_print(fout, "(%s, %s)\n", RQSTP, TRANSP);
 458      -                        f_print(fout, " struct svc_req *%s;\n", RQSTP);
 459      -                        f_print(fout, " register SVCXPRT *%s;\n", TRANSP);
 460      -                }
      424 +                f_print(fout, "(struct svc_req *%s, ", RQSTP);
      425 +                f_print(fout, "register SVCXPRT *%s)\n", TRANSP);
 461  426  
 462  427                  f_print(fout, "{\n");
 463  428  
 464  429                  filled = 0;
 465  430                  f_print(fout, "\tunion {\n");
 466  431                  for (proc = vp->procs; proc != NULL; proc = proc->next) {
 467  432                          if (proc->arg_num < 2) { /* single argument */
 468  433                                  if (streq(proc->args.decls->decl.type,
 469  434                                      "void")) {
 470  435                                          continue;
↓ open down ↓ 33 lines elided ↑ open up ↑
 504  469                                  f_print(fout, "_res;\n");
 505  470                          }
 506  471                          if (!filled)
 507  472                                  f_print(fout, "\t\tint fill;\n");
 508  473                          f_print(fout, "\t} %s;\n", RESULT);
 509  474                          f_print(fout, "\tbool_t %s;\n", RETVAL);
 510  475  
 511  476                  } else
 512  477                          f_print(fout, "\tchar *%s;\n", RESULT);
 513  478  
 514      -                if (Cflag) {
 515      -                        f_print(fout, "\txdrproc_t _xdr_%s, _xdr_%s;\n",
 516      -                            ARG, RESULT);
 517      -                        if (mtflag)
 518      -                                f_print(fout,
 519      -"\tbool_t (*%s)(char *, void *, struct svc_req *);\n",
 520      -                                    ROUTINE);
 521      -                        else
 522      -                                f_print(fout,
 523      -"\tchar *(*%s)(char *, struct svc_req *);\n",
 524      -                                    ROUTINE);
 525      -                } else {
 526      -                        f_print(fout,
 527      -                            "\tbool_t (*_xdr_%s)(), (*_xdr_%s)();\n",
 528      -                            ARG, RESULT);
 529      -                        if (mtflag)
 530      -                                f_print(fout, "\tbool_t (*%s)();\n", ROUTINE);
 531      -                        else
 532      -                                f_print(fout, "\tchar *(*%s)();\n", ROUTINE);
 533      -                }
      479 +                f_print(fout, "\txdrproc_t _xdr_%s, _xdr_%s;\n", ARG, RESULT);
      480 +                if (mtflag)
      481 +                        f_print(fout, "\tbool_t "
      482 +                            "(*%s)(char *, void *, struct svc_req *);\n",
      483 +                            ROUTINE);
      484 +                else
      485 +                        f_print(fout, "\tchar *(*%s)"
      486 +                            "(char *, struct svc_req *);\n",
      487 +                            ROUTINE);
 534  488                  f_print(fout, "\n");
 535  489  
 536  490                  if (timerflag) {
 537  491                          if (mtflag)
 538  492                                  f_print(fout,
 539  493  "\t(void) mutex_lock(&_svcstate_lock);\n");
 540  494  
 541  495                          f_print(fout, "\t_rpcsvccount++;\n");
 542  496                          if (mtflag)
 543  497                                  f_print(fout,
 544  498  "\t(void) mutex_unlock(&_svcstate_lock);\n");
 545  499                  }
 546  500  
 547  501                  f_print(fout, "\tswitch (%s->rq_proc) {\n", RQSTP);
 548  502                  if (!nullproc(vp->procs)) {
 549  503                          f_print(fout, "\tcase NULLPROC:\n");
 550  504                          f_print(fout,
 551      -                            Cflag ?
 552      -"\t\t(void) svc_sendreply(%s,\n\t\t    (xdrproc_t)xdr_void, NULL);\n" :
 553      -"\t\t(void) svc_sendreply(%s, xdr_void,\n\t\t\tNULL);\n",
      505 +"\t\t(void) svc_sendreply(%s,\n\t\t    (xdrproc_t)xdr_void, NULL);\n",
 554  506                              TRANSP);
 555  507                          print_return("\t\t");
 556  508                          f_print(fout, "\n");
 557  509                  }
 558  510                  for (proc = vp->procs; proc != NULL; proc = proc->next) {
 559  511                          f_print(fout, "\tcase %s:\n", proc->proc_name);
 560  512                          if (proc->arg_num < 2) { /* single argument */
 561  513                                  p_xdrfunc(ARG, proc->args.decls->decl.type);
 562  514                          } else {
 563  515                                  p_xdrfunc(ARG, proc->args.argname);
 564  516                          }
 565  517  
 566  518                          if (streq(proc->res_type, "oneway")) {
 567  519                                  /* One-way call */
 568  520                                  f_print(fout, "\t\t_xdr_%s = NULL;\n", RESULT);
 569  521                          } else {
 570  522                                  p_xdrfunc(RESULT, proc->res_type);
 571  523                          }
 572      -                        if (Cflag) {
 573      -                                if (mtflag) {
 574      -                                        f_print(fout,
 575      -                                            "\t\t%s = (bool_t (*) (char *,  "
 576      -                                            "void *,  struct svc_req *))",
 577      -                                            ROUTINE);
 578      -                                } else {
 579      -                                        f_print(fout,
 580      -                                            "\t\t%s = (char *(*)(char *, "
 581      -                                            "struct svc_req *))",
 582      -                                            ROUTINE);
 583      -                                }
      524 +                        if (mtflag) {
      525 +                                f_print(fout,
      526 +                                    "\t\t%s = (bool_t (*) (char *,  "
      527 +                                    "void *,  struct svc_req *))",
      528 +                                    ROUTINE);
 584  529                          } else {
 585      -                                if (mtflag) {
 586      -                                        f_print(fout,
 587      -                                            "\t\t%s = (bool_t (*)())",
 588      -                                            ROUTINE);
 589      -                                } else {
 590      -                                        f_print(fout, "\t\t%s = (char *(*)())",
 591      -                                            ROUTINE);
 592      -                                }
      530 +                                f_print(fout,
      531 +                                    "\t\t%s = (char *(*)(char *, "
      532 +                                    "struct svc_req *))",
      533 +                                    ROUTINE);
 593  534                          }
 594  535  
 595  536                          f_print(fout, "\n\t\t    ");
 596  537                          if (newstyle) { /* new style: calls internal routine */
 597  538                                  f_print(fout, "_");
 598  539                          }
 599      -                        if ((Cflag || mtflag) && !newstyle)
      540 +                        if (!newstyle)
 600  541                                  pvname_svc(proc->proc_name, vp->vers_num);
 601  542                          else
 602  543                                  pvname(proc->proc_name, vp->vers_num);
 603  544                          f_print(fout, ";\n");
 604  545                          f_print(fout, "\t\tbreak;\n\n");
 605  546                  }
 606  547                  f_print(fout, "\tdefault:\n");
 607  548                  printerr("noproc", TRANSP);
 608  549                  print_return("\t\t");
 609  550                  f_print(fout, "\t}\n");
 610  551  
 611  552                  f_print(fout,
 612  553                      "\t(void) memset((char *)&%s, 0, sizeof (%s));\n",
 613  554                      ARG, ARG);
 614  555                  printif("getargs", TRANSP, "(caddr_t)&", ARG);
 615  556                  printerr("decode", TRANSP);
 616  557                  print_return("\t\t");
 617  558                  f_print(fout, "\t}\n");
 618  559  
 619  560                  if (!mtflag)
 620      -                        if (Cflag)
 621      -                                f_print(fout,
 622      -                                    "\t%s = (*%s)((char *)&%s, %s);\n",
 623      -                                    RESULT, ROUTINE, ARG, RQSTP);
 624      -                        else
 625      -                                f_print(fout, "\t%s = (*%s)(&%s, %s);\n",
 626      -                                    RESULT, ROUTINE, ARG, RQSTP);
      561 +                        f_print(fout,
      562 +                            "\t%s = (*%s)((char *)&%s, %s);\n",
      563 +                            RESULT, ROUTINE, ARG, RQSTP);
 627  564                  else
 628      -                        if (Cflag)
 629      -                                f_print(fout,
 630      -"\t%s = (bool_t)(*%s)((char *)&%s, (void *)&%s, %s);\n",
 631      -                                    RETVAL, ROUTINE, ARG, RESULT, RQSTP);
 632      -                        else
 633      -                                f_print(fout,
 634      -"\t%s = (bool_t)(*%s)(&%s, &%s, %s);\n",
 635      -                                    RETVAL, ROUTINE, ARG, RESULT, RQSTP);
      565 +                        f_print(fout,
      566 +                            "\t%s = (bool_t)(*%s)"
      567 +                            "((char *)&%s, (void *)&%s, %s);\n",
      568 +                            RETVAL, ROUTINE, ARG, RESULT, RQSTP);
 636  569  
 637  570  
 638  571  
 639      -
 640  572                  if (mtflag)
 641  573                          f_print(fout,
 642  574  "\tif (_xdr_%s && %s > 0 &&\n"
 643  575  "\t    !svc_sendreply(%s, _xdr_%s, (char *)&%s)) {\n",
 644  576                              RESULT, RETVAL, TRANSP, RESULT, RESULT);
 645  577                  else
 646  578                          f_print(fout,
 647  579  "\tif (_xdr_%s && %s != NULL &&\n"
 648  580  "\t    !svc_sendreply(%s, _xdr_%s, %s)) {\n",
 649  581                              RESULT, RESULT, TRANSP, RESULT, RESULT);
↓ open down ↓ 156 lines elided ↑ open up ↑
 806  738   * calls are of the form "%s","<msg>" and this implementation assumes that
 807  739   * trivial case.  If in the future it's desirable to generate richer calls
 808  740   * this implementation can change to match.  This way we don't (yet) have
 809  741   * to introduce varargs into the generated code.
 810  742   */
 811  743  static void
 812  744  write_msg_out(void)
 813  745  {
 814  746          f_print(fout, "\n");
 815  747          f_print(fout, "#if\tdefined(RPC_MSGOUT)\n");
 816      -        if (!Cflag) {
 817      -                f_print(fout, "extern void RPC_MSGOUT();\n");
 818      -        } else {
 819      -                f_print(fout, "extern void RPC_MSGOUT(const char *, ...);\n");
 820      -        }
      748 +        f_print(fout, "extern void RPC_MSGOUT(const char *, ...);\n");
 821  749          f_print(fout, "#else\t/* defined(RPC_MSGOUT) */\n");
 822  750          f_print(fout, "static ");
 823      -        if (!Cflag) {
 824      -                f_print(fout, "void\nRPC_MSGOUT(fmt, msg)\n");
 825      -                f_print(fout, "\tchar *fmt;\n");
 826      -                f_print(fout, "\tchar *msg;\n");
 827      -        } else {
 828      -                f_print(fout, "void\nRPC_MSGOUT(const char *fmt, char *msg)\n");
 829      -        }
      751 +        f_print(fout, "void\nRPC_MSGOUT(const char *fmt, char *msg)\n");
 830  752          f_print(fout, "{\n");
 831  753          f_print(fout, "#ifdef RPC_SVC_FG\n");
 832  754          if (inetdflag || pmflag)
 833  755                  f_print(fout, "\tif (_rpcpmstart)\n");
 834  756          f_print(fout, "\t\tsyslog(LOG_ERR, fmt, msg);\n");
 835  757          f_print(fout, "\telse {\n");
 836  758          f_print(fout, "\t\t(void) fprintf(stderr, fmt, msg);\n");
 837  759          f_print(fout, "\t\t(void) putc('\\n', stderr);\n");
 838  760          f_print(fout, "\t}\n");
 839  761          f_print(fout, "#else\n");
↓ open down ↓ 9 lines elided ↑ open up ↑
 849  771  static void
 850  772  write_timeout_func(void)
 851  773  {
 852  774          if (!timerflag)
 853  775                  return;
 854  776  
 855  777          f_print(fout, "\n");
 856  778          if (mtflag) {
 857  779                  f_print(fout, "/*ARGSUSED*/\n");
 858  780                  f_print(fout, "static void *\n");
 859      -                if (!Cflag) {
 860      -                        f_print(fout, "closedown(arg)\n");
 861      -                        f_print(fout, "\tvoid *arg;\n");
 862      -                } else
 863      -                        f_print(fout, "closedown(void *arg)\n");
      781 +                f_print(fout, "closedown(void *arg)\n");
 864  782                  f_print(fout, "{\n");
 865  783                  f_print(fout, "\t/*CONSTCOND*/\n");
 866  784                  f_print(fout, "\twhile (1) {\n");
 867  785                  f_print(fout, "\t\t(void) sleep(_RPCSVC_CLOSEDOWN/2);\n\n");
 868  786                  f_print(fout,
 869  787  "\t\tif (mutex_trylock(&_svcstate_lock) != 0)\n");
 870  788                  f_print(fout, "\t\t\tcontinue;\n\n");
 871  789                  f_print(fout,
 872  790  "\t\tif (_rpcsvcstate == _IDLE && _rpcsvccount == 0) {\n");
 873  791                  if (tirpcflag) {
↓ open down ↓ 22 lines elided ↑ open up ↑
 896  814                  f_print(fout, "\t\t\t\texit(0);\n");
 897  815                  f_print(fout, "\t\t} else\n");
 898  816                  f_print(fout, "\t\t\t_rpcsvcstate = _IDLE;\n\n");
 899  817                  f_print(fout, "\t\t(void) mutex_unlock(&_svcstate_lock);\n");
 900  818                  f_print(fout, "\t}\n");
 901  819                  f_print(fout, "}\n");
 902  820                  return;
 903  821          }
 904  822  
 905  823          f_print(fout, "static void\n");
 906      -        if (!Cflag) {
 907      -                f_print(fout, "closedown(sig)\n");
 908      -                f_print(fout, "\tint sig;\n");
 909      -        } else
 910      -                f_print(fout, "closedown(int sig)\n");
      824 +        f_print(fout, "closedown(int sig)\n");
 911  825          f_print(fout, "{\n");
 912  826          f_print(fout, "\tif (_rpcsvcstate == _IDLE && _rpcsvccount == 0) {\n");
 913  827          if (tirpcflag) {
 914  828                  f_print(fout, "\t\tint size;\n");
 915  829          } else {
 916  830                  f_print(fout, "\t\textern fd_set svc_fdset;\n");
 917  831                  f_print(fout, "\t\tstatic int size;\n");
 918  832          }
 919  833          f_print(fout, "\t\tint i, openfd = 0;\n\n");
 920  834          if (tirpcflag) {
↓ open down ↓ 9 lines elided ↑ open up ↑
 930  844                  f_print(fout, "\t\t\tif (svc_pollfd[i].fd >= 0)\n");
 931  845          } else {
 932  846                  f_print(fout, "\t\t\tif (FD_ISSET(i, &svc_fdset))\n");
 933  847          }
 934  848          f_print(fout, "\t\t\t\topenfd++;\n");
 935  849          f_print(fout, "\t\tif (openfd <= 1)\n");
 936  850          f_print(fout, "\t\t\texit(0);\n");
 937  851          f_print(fout, "\t} else\n");
 938  852          f_print(fout, "\t\t_rpcsvcstate = _IDLE;\n\n");
 939  853  
 940      -        f_print(fout, "\t(void) signal(SIGALRM, %s closedown);\n",
 941      -            Cflag? "(SIG_PF)" : "(void(*)())");
      854 +        f_print(fout, "\t(void) signal(SIGALRM, (SIG_PF) closedown);\n");
 942  855          f_print(fout, "\t(void) alarm(_RPCSVC_CLOSEDOWN/2);\n");
 943  856          f_print(fout, "}\n");
 944  857  }
 945  858  
 946  859  /*
 947  860   * Write the most of port monitor support
 948  861   */
 949  862  static void
 950  863  write_pm_most(char *infile, int netflag)
 951  864  {
↓ open down ↓ 68 lines elided ↑ open up ↑
1020  933                  f_print(fout, "\t\tif (pmclose) {\n");
1021  934                  if (mtflag) {
1022  935                          f_print(fout,
1023  936  "\t\t\tif (thr_create(NULL, 0, closedown, NULL,\n\t\t\t    0, NULL) != 0) {\n");
1024  937                          print_err_message("\t\t\t\t",
1025  938                              "cannot create closedown thread");
1026  939                          f_print(fout, "\t\t\t\texit(1);\n");
1027  940                          f_print(fout, "\t\t\t}\n");
1028  941                  } else {
1029  942                          f_print(fout,
1030      -"\t\t\t(void) signal(SIGALRM, %s closedown);\n",
1031      -                            Cflag? "(SIG_PF)" : "(void(*)())");
      943 +"\t\t\t(void) signal(SIGALRM, (SIG_PF) closedown);\n");
1032  944                          f_print(fout,
1033  945  "\t\t\t(void) alarm(_RPCSVC_CLOSEDOWN/2);\n");
1034  946                  }
1035  947                  f_print(fout, "\t\t}\n");
1036  948          }
1037  949          f_print(fout, "\t\tsvc_run();\n");
1038  950          f_print(fout, "\t\texit(1);\n");
1039  951          f_print(fout, "\t\t/* NOTREACHED */\n");
1040  952          f_print(fout, "\t}");
1041  953  }
↓ open down ↓ 141 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX