home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / x / volume20 / xroute / patch02 < prev    next >
Encoding:
Text File  |  1993-06-14  |  2.9 KB  |  84 lines

  1. Newsgroups: comp.sources.x
  2. From: subbarao@concorde.fc.hp.com (Kartik Subbarao)
  3. Subject: v20i025:  xroute - Route X-Protocol through Internet gateways, Patch02
  4. Message-ID: <1993Jun15.134831.16428@sparky.imd.sterling.com>
  5. X-Md4-Signature: 567cf1210ad21eb2bc472ba834146544
  6. Sender: chris@sparky.imd.sterling.com (Chris Olson)
  7. Organization: Sterling Software
  8. Date: Tue, 15 Jun 1993 13:48:31 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 25
  13. Archive-name: xroute/patch02
  14. Environment: X11, net
  15. Patch-To: xroute: Volume 19, Issue 89
  16.  
  17. Patch 2, 6/3/93: Thanks to Klamer Schutte <klamer@mi.el.utwente.nl> for 
  18. pointing this out.
  19. + Moved the writeability checks into a separate select() after the
  20. readability checks. This is because writeability is almost always a sure
  21. thing, and the program ends up in a spin loop, burning unnecessary CPU cycles.
  22.  
  23. This latest version of xroute is also available on
  24. export.lcs.mit.edu:/contrib/xroute.6.3.93.tar.Z.
  25.     
  26.     -Kartik
  27.  
  28. #!/bin/sh
  29. # This is a shell archive (produced by shar 3.49)
  30. # To extract the files from this archive, save it to a file, remove
  31. # everything above the "!/bin/sh" line above, and type "sh file_name".
  32. #
  33. # made 06/03/1993 20:02 UTC by subbarao@concorde
  34. # Source directory /nfs/phoenix/users/subbarao/x/xroute
  35. #
  36. # existing files will NOT be overwritten unless -c is specified
  37. #
  38. # This shar contains:
  39. # length  mode       name
  40. # ------ ---------- ------------------------------------------
  41. #    722 -rw------- patch2
  42. #
  43. # ============= patch2 ==============
  44. if test -f 'patch2' -a X"$1" != X"-c"; then
  45.     echo 'x - skipping patch2 (File already exists)'
  46. else
  47. echo 'x - extracting patch2 (Text)'
  48. sed 's/^X//' << 'SHAR_EOF' > 'patch2' &&
  49. *** xroute.5.28.c    Thu Jun  3 10:34:30 1993
  50. --- xroute.c    Thu Jun  3 10:43:47 1993
  51. ***************
  52. *** 89,95 ****
  53. X      trdset = rdset; twrset = wrset;
  54. X      
  55. X      for (;; rdset = trdset, wrset = twrset) {
  56. !         if (select(maxfds, &rdset, &wrset, NULL, NULL) == -1) exit(1);
  57. X  
  58. X          if (FD_ISSET(ls, &rdset) && FD_ISSET(rs, &wrset)) {
  59. X              if ((n = read(ls, buf, sizeof buf)) <= 0) exit(n);
  60. --- 89,96 ----
  61. X      trdset = rdset; twrset = wrset;
  62. X      
  63. X      for (;; rdset = trdset, wrset = twrset) {
  64. !         if (select(maxfds, &rdset, NULL, NULL, NULL) == -1) exit(1);
  65. !         if (select(maxfds, NULL, &wrset, NULL, NULL) == -1) exit(1);
  66. X  
  67. X          if (FD_ISSET(ls, &rdset) && FD_ISSET(rs, &wrset)) {
  68. X              if ((n = read(ls, buf, sizeof buf)) <= 0) exit(n);
  69. SHAR_EOF
  70. chmod 0600 patch2 ||
  71. echo 'restore of patch2 failed'
  72. Wc_c="`wc -c < 'patch2'`"
  73. test 722 -eq "$Wc_c" ||
  74.     echo 'patch2: original size 722, current size' "$Wc_c"
  75. fi
  76. exit 0
  77.  
  78. exit 0 # Just in case...
  79. -- 
  80.   // chris@IMD.Sterling.COM       | Send comp.sources.x submissions to:
  81. \X/  Amiga - The only way to fly! |    sources-x@imd.sterling.com
  82.  "It's intuitively obvious to the |
  83.   most casual observer..."        | GCS d+/-- p+ c++ l+ m+ s++/+ g+ w+ t+ r+ x+
  84.