home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / x / volume20 / xroute / patch01 < prev    next >
Encoding:
Text File  |  1993-05-31  |  3.4 KB  |  115 lines

  1. Newsgroups: comp.sources.x
  2. From: subbarao@concorde.fc.hp.com (Kartik Subbarao)
  3. Subject: v20i009:  xroute - Route X-Protocol through Internet gateways, Patch01
  4. Message-ID: <1993Jun1.231310.10874@sparky.imd.sterling.com>
  5. X-Md4-Signature: c5ae0db39d41a7d8d0d65f8786858903
  6. Sender: chris@sparky.imd.sterling.com (Chris Olson)
  7. Organization: Sterling Software
  8. Date: Tue, 1 Jun 1993 23:13:10 GMT
  9. Approved: chris@sparky.imd.sterling.com
  10.  
  11. Submitted-by: subbarao@concorde.fc.hp.com (Kartik Subbarao)
  12. Posting-number: Volume 20, Issue 9
  13. Archive-name: xroute/patch01
  14. Environment: X11
  15. Patch-To: xroute: Volume 19, Issue 89
  16.  
  17. Patch 1, 5/28/93: Thanks to Michael Patton <map@bbn.com> for these enhancements.
  18. + recognizes the DISPLAY environment variable to specify a host
  19. + properly closes the listen()ed to socket in the child process so that 
  20.   requests occuring after the maximum number of clients specified exit 
  21.   properly instead of hanging. 
  22.  
  23.     -Kartik
  24.  
  25. This latest version of xroute is also available on 
  26. export.lcs.mit.edu:/contrib/xroute.5.28.93.tar.Z.
  27.  
  28. #! /bin/sh
  29. # This is a shell archive.  Remove anything before this line, then feed it
  30. # into a shell via "sh file" or similar.  To overwrite existing files,
  31. # type "sh file -c".
  32. # Contents:  patch
  33. # Wrapped by chris@sparky on Tue Jun  1 18:06:38 1993
  34. PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/lbin ; export PATH
  35. echo If this archive is complete, you will see the following message:
  36. echo '          "shar: End of archive."'
  37. if test -f 'patch' -a "${1}" != "-c" ; then 
  38.   echo shar: Will not clobber existing file \"'patch'\"
  39. else
  40.   echo shar: Extracting \"'patch'\" \(1307 characters\)
  41.   sed "s/^X//" >'patch' <<'END_OF_FILE'
  42. X*** xroute.c.orig    Fri May 28 18:57:44 1993
  43. X--- xroute.c    Fri May 28 19:16:49 1993
  44. X***************
  45. X*** 31,36 ****
  46. X--- 31,38 ----
  47. X  waiter() { union wait st; while (wait3(&st, WNOHANG, NULL) > 0); }
  48. X  #endif
  49. X  
  50. X+ extern char *getenv();
  51. X+ 
  52. X  main(argc, argv)
  53. X  int argc; char *argv[];
  54. X  {
  55. X***************
  56. X*** 47,56 ****
  57. X          default: usage();
  58. X          }
  59. X      
  60. X!     if (!argv[optind]) usage();
  61. X!     ldisp = (p = strchr(argv[optind], ':')) && p[1] ? atoi(p+1) : 0;
  62. X!     if (p) *p = '\0'; lhost = argv[optind];
  63. X  
  64. X      gs = tcpssocket(gdisp);
  65. X      signal(SIGCHLD, waiter);
  66. X      signal(SIGHUP, SIG_IGN);
  67. X--- 49,60 ----
  68. X          default: usage();
  69. X          }
  70. X      
  71. X!     if (!(lhost = argv[optind]))
  72. X!         if (!(lhost = getenv("DISPLAY"))) usage();
  73. X  
  74. X+     ldisp = (p = strchr(lhost, ':')) && p[1] ? atoi(p+1) : 0;
  75. X+     if (p) *p = '\0';
  76. X+ 
  77. X      gs = tcpssocket(gdisp);
  78. X      signal(SIGCHLD, waiter);
  79. X      signal(SIGHUP, SIG_IGN);
  80. X***************
  81. X*** 62,68 ****
  82. X          if (rs == -1) exit(1);
  83. X          switch (fork()) {
  84. X          case -1: exit(1);
  85. X!         case 0: ls = tcpcsocket(lhost, XPORT + ldisp); route(ls, rs); break;
  86. X          default: close(rs);
  87. X          }
  88. X      }
  89. X--- 66,75 ----
  90. X          if (rs == -1) exit(1);
  91. X          switch (fork()) {
  92. X          case -1: exit(1);
  93. X!         case 0: 
  94. X!             close(gs); 
  95. X!             ls = tcpcsocket(lhost, XPORT + ldisp); route(ls, rs); 
  96. X!             break;
  97. X          default: close(rs);
  98. X          }
  99. X      }
  100. X
  101. END_OF_FILE
  102.   if test 1307 -ne `wc -c <'patch'`; then
  103.     echo shar: \"'patch'\" unpacked with wrong size!
  104.   fi
  105.   # end of 'patch'
  106. fi
  107. echo shar: End of archive.
  108. exit 0
  109. exit 0 # Just in case...
  110. -- 
  111.   // chris@IMD.Sterling.COM       | Send comp.sources.x submissions to:
  112. \X/  Amiga - The only way to fly! |    sources-x@imd.sterling.com
  113.  "It's intuitively obvious to the |
  114.   most casual observer..."        | GCS d+/-- p+ c++ l+ m+ s++/+ g+ w+ t+ r+ x+
  115.