[BACK]Return to rpc_svcout.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / rpcgen

Diff for /src/usr.bin/rpcgen/rpc_svcout.c between version 1.27 and 1.28

version 1.27, 2012/12/05 23:20:26 version 1.28, 2019/06/28 13:35:03
Line 718 
Line 718 
         definition *def;          definition *def;
         version_list *vp;          version_list *vp;
   
         fprintf(fout, "\tif (!ioctl(0, I_LOOK, mname) &&\n");          fprintf(fout, "\tif (!ioctl(0, I_LOOK, mname) == -1 &&\n");
         fprintf(fout, "\t\t(!strcmp(mname, \"sockmod\") ||");          fprintf(fout, "\t\t(!strcmp(mname, \"sockmod\") ||");
         fprintf(fout, " !strcmp(mname, \"timod\"))) {\n");          fprintf(fout, " !strcmp(mname, \"timod\"))) {\n");
         fprintf(fout, "\t\tchar *netid;\n");          fprintf(fout, "\t\tchar *netid;\n");
Line 746 
Line 746 
          * sockmod, and RPC works only with timod, hence all this jugglery           * sockmod, and RPC works only with timod, hence all this jugglery
          */           */
         fprintf(fout, "\t\tif (strcmp(mname, \"sockmod\") == 0) {\n");          fprintf(fout, "\t\tif (strcmp(mname, \"sockmod\") == 0) {\n");
         fprintf(fout, "\t\t\tif (ioctl(0, I_POP, 0) || ioctl(0, I_PUSH, \"timod\")) {\n");          fprintf(fout, "\t\t\tif (ioctl(0, I_POP, 0) == -1 || ioctl(0, I_PUSH, \"timod\") == -1) {\n");
         snprintf(_errbuf, sizeof _errbuf, "could not get the right module");          snprintf(_errbuf, sizeof _errbuf, "could not get the right module");
         print_err_message("\t\t\t\t");          print_err_message("\t\t\t\t");
         fprintf(fout, "\t\t\t\texit(1);\n");          fprintf(fout, "\t\t\t\texit(1);\n");
Line 810 
Line 810 
                 fprintf(fout, "%spid_t pid;\n\n", sp);                  fprintf(fout, "%spid_t pid;\n\n", sp);
         }          }
         fprintf(fout, "%spid = fork();\n", sp);          fprintf(fout, "%spid = fork();\n", sp);
         fprintf(fout, "%sif (pid < 0) {\n", sp);          fprintf(fout, "%sif (pid == -1) {\n", sp);
         fprintf(fout, "%s\tperror(\"cannot fork\");\n", sp);          fprintf(fout, "%s\tperror(\"cannot fork\");\n", sp);
         fprintf(fout, "%s\texit(1);\n", sp);          fprintf(fout, "%s\texit(1);\n", sp);
         fprintf(fout, "%s}\n", sp);          fprintf(fout, "%s}\n", sp);
Line 837 
Line 837 
                 fprintf(fout, "%ssetsid();\n", sp);                  fprintf(fout, "%ssetsid();\n", sp);
         else {          else {
                 fprintf(fout, "%si = open(\"/dev/tty\", 2);\n", sp);                  fprintf(fout, "%si = open(\"/dev/tty\", 2);\n", sp);
                 fprintf(fout, "%sif (i >= 0) {\n", sp);                  fprintf(fout, "%sif (i != -1) {\n", sp);
                 fprintf(fout, "%s\t(void) ioctl(i, TIOCNOTTY, (char *)NULL);\n", sp);                  fprintf(fout, "%s\t(void) ioctl(i, TIOCNOTTY, (char *)NULL);\n", sp);
                 fprintf(fout, "%s\t(void) close(i);\n", sp);                  fprintf(fout, "%s\t(void) close(i);\n", sp);
                 fprintf(fout, "%s}\n", sp);                  fprintf(fout, "%s}\n", sp);

Legend:
Removed from v.1.27  
changed lines
  Added in v.1.28