home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume22 / ecu / patch02 / PATCH2.01 next >
Encoding:
Text File  |  1991-08-16  |  28.4 KB  |  1,275 lines

  1. :
  2. #-------------------------------------------------------
  3. # PATCH2.01
  4. # UNIX & ISC nap bug fix
  5. # created by gendiff x1.03 on 13 Aug 1991 20:04 UTC
  6. #-------------------------------------------------------
  7. *** /u1/src/ecu311/patchlevel.h    Tue Aug  6 15:05:00 1991
  8. --- patchlevel.h    Tue Aug 13 16:07:17 1991
  9. Prereq: 11
  10. ***************
  11. *** 1,1
  12. ! #define PATCHLEVEL 11
  13.  
  14. --- 1,1 -----
  15. ! #define PATCHLEVEL 12
  16. *** /u1/src/ecu311/ecu.c    Tue Aug 13 15:53:05 1991
  17. --- ecu.c    Tue Aug 13 13:50:42 1991
  18. ***************
  19. *** 186,192
  20.           hz = atoi(getenv("HZ"));
  21.       else
  22.           hz = HZ;
  23. !     hzmsec = (ulong)(1000 / hz) + 1;
  24.   
  25.   /*
  26.    * if we are root (or setuid to root as we should be on 286 versions),
  27.  
  28. --- 186,192 -----
  29.           hz = atoi(getenv("HZ"));
  30.       else
  31.           hz = HZ;
  32. !     hzmsec = (ulong)(1000 / hz) + 2;
  33.   
  34.   /*
  35.    * if we are root (or setuid to root as we should be on 286 versions),
  36. ***************
  37. *** 324,330
  38.   */
  39.           ff(se,
  40.       "No problem, but just to warn you, the keyboard has parity enabled\r\n");
  41. !         nap(500L);
  42.       }
  43.   
  44.   /* check out line */
  45.  
  46. --- 324,330 -----
  47.   */
  48.           ff(se,
  49.       "No problem, but just to warn you, the keyboard has parity enabled\r\n");
  50. !         Nap(500L);
  51.       }
  52.   
  53.   /* check out line */
  54. ***************
  55. *** 343,349
  56.                   tcap_stand_end();
  57.                   ff(se,"\r\n");
  58.                   strcpy(shm->Lline,default_tty);
  59. !                 nap(1000L);
  60.               }
  61.           }
  62.       }
  63.  
  64. --- 343,349 -----
  65.                   tcap_stand_end();
  66.                   ff(se,"\r\n");
  67.                   strcpy(shm->Lline,default_tty);
  68. !                 Nap(1000L);
  69.               }
  70.           }
  71.       }
  72. *** /u1/src/ecu311/ecu.h    Tue Aug 13 15:53:05 1991
  73. --- ecu.h    Tue Aug 13 13:58:20 1991
  74. ***************
  75. *** 3,8
  76.       wht@n4hgf.Mt-Park.GA.US
  77.   ------------------------------------------------------------------------*/
  78.   /*+:EDITS:*/
  79.   /*:08-09-1991-11:07-wht@n4hgf-configurable lock directory */
  80.   /*:07-25-1991-12:55-wht@n4hgf-ECU release 3.10 */
  81.   /*:01-25-1991-06:08-wht@n4hgf-mulltiple #define of ECULIBDIR */
  82.  
  83. --- 3,9 -----
  84.       wht@n4hgf.Mt-Park.GA.US
  85.   ------------------------------------------------------------------------*/
  86.   /*+:EDITS:*/
  87. + /*:08-13-1991-13:53-wht@n4hgf-UNIX and ISC nap() broken; XENIX still wins */
  88.   /*:08-09-1991-11:07-wht@n4hgf-configurable lock directory */
  89.   /*:07-25-1991-12:55-wht@n4hgf-ECU release 3.10 */
  90.   /*:01-25-1991-06:08-wht@n4hgf-mulltiple #define of ECULIBDIR */
  91. ***************
  92. *** 88,93
  93.   #if defined(MALLOC_3X)
  94.   #include <malloc.h>
  95.   #endif
  96.   
  97.   /*
  98.    * prototyes or external declarations
  99.  
  100. --- 89,96 -----
  101.   #if defined(MALLOC_3X)
  102.   #include <malloc.h>
  103.   #endif
  104. + long Nap();
  105.   
  106.   /*
  107.    * prototyes or external declarations
  108. *** /u1/src/ecu311/ecuDCE.c    Thu Jul 25 12:55:00 1991
  109. --- ecuDCE.c    Tue Aug 13 13:50:42 1991
  110. ***************
  111. *** 43,49
  112.   #include "relop.h"
  113.   
  114.   long time();
  115. ! long nap();
  116.   
  117.   char *make_char_graphic();
  118.   void DCE_hangup();
  119.  
  120. --- 43,49 -----
  121.   #include "relop.h"
  122.   
  123.   long time();
  124. ! long Nap();
  125.   
  126.   char *make_char_graphic();
  127.   void DCE_hangup();
  128. ***************
  129. *** 345,351
  130.       DCE_read_modem_init();
  131.   
  132.       lputs_paced(0,"\b\b\b\b\b\b\b\b\b\r");
  133. !     (void)nap(200L);
  134.       lflush(0);
  135.   
  136.       while(!shm->Lmodem_already_init)
  137.  
  138. --- 345,351 -----
  139.       DCE_read_modem_init();
  140.   
  141.       lputs_paced(0,"\b\b\b\b\b\b\b\b\b\r");
  142. !     (void)Nap(200L);
  143.       lflush(0);
  144.   
  145.       while(!shm->Lmodem_already_init)
  146. ***************
  147. *** 361,367
  148.           {
  149.               ltoggle_dtr();
  150.               lputs_paced(0,"AT\r");
  151. !             (void)nap(400L);
  152.               lputs_paced(0,"ATQ0V1E1\r");
  153.               (void)nap(400L);
  154.           }
  155.  
  156. --- 361,367 -----
  157.           {
  158.               ltoggle_dtr();
  159.               lputs_paced(0,"AT\r");
  160. !             (void)Nap(400L);
  161.               lputs_paced(0,"ATQ0V1E1\r");
  162.               (void)Nap(400L);
  163.           }
  164. ***************
  165. *** 363,369
  166.               lputs_paced(0,"AT\r");
  167.               (void)nap(400L);
  168.               lputs_paced(0,"ATQ0V1E1\r");
  169. !             (void)nap(400L);
  170.           }
  171.   
  172.           lflush(0);
  173.  
  174. --- 363,369 -----
  175.               lputs_paced(0,"AT\r");
  176.               (void)Nap(400L);
  177.               lputs_paced(0,"ATQ0V1E1\r");
  178. !             (void)Nap(400L);
  179.           }
  180.   
  181.           lflush(0);
  182. ***************
  183. *** 374,380
  184.           {
  185.               lputc_paced(0,*cmd++);
  186.               if(++itmp < 2)
  187. !                 (void)nap(40L);
  188.               if((itmp = lgetc_timeout(500L)) < 0)
  189.               {
  190.                   if(sigint)
  191.  
  192. --- 374,380 -----
  193.           {
  194.               lputc_paced(0,*cmd++);
  195.               if(++itmp < 2)
  196. !                 (void)Nap(40L);
  197.               if((itmp = lgetc_timeout(500L)) < 0)
  198.               {
  199.                   if(sigint)
  200. ***************
  201. *** 438,444
  202.   register itmp;
  203.   
  204.       DCE_modem_init();
  205. !     (void)nap(600L);
  206.   
  207.       lflush(0);
  208.   #ifdef NEUROTIC
  209.  
  210. --- 438,444 -----
  211.   register itmp;
  212.   
  213.       DCE_modem_init();
  214. !     (void)Nap(600L);
  215.   
  216.       lflush(0);
  217.   #ifdef NEUROTIC
  218. ***************
  219. *** 446,452
  220.       {
  221.           lputc_paced(20,*cmd++);
  222.           if(++char_count < 2)
  223. !             (void)nap(40L);
  224.           if((itmp = lgetc_timeout(500L)) < 0)
  225.               return(-1);
  226.           pputc(itmp);
  227.  
  228. --- 446,452 -----
  229.       {
  230.           lputc_paced(20,*cmd++);
  231.           if(++char_count < 2)
  232. !             (void)Nap(40L);
  233.           if((itmp = lgetc_timeout(500L)) < 0)
  234.               return(-1);
  235.           pputc(itmp);
  236. ***************
  237. *** 624,630
  238.               setcolor(colors_error);
  239.               pprintf("%s\n",result);
  240.               lputc(0);                /* make modem go on hook */
  241. !             (void)nap(40L);
  242.               lputc(0);
  243.               sigint = 0;
  244.               (void)DCE_get_result(2000L);    /* wait for NO CARRIER */
  245.  
  246. --- 624,630 -----
  247.               setcolor(colors_error);
  248.               pprintf("%s\n",result);
  249.               lputc(0);                /* make modem go on hook */
  250. !             (void)Nap(40L);
  251.               lputc(0);
  252.               sigint = 0;
  253.               (void)DCE_get_result(2000L);    /* wait for NO CARRIER */
  254. ***************
  255. *** 849,855
  256.               delay,(kbdintr == DEL) ?"DEL":make_char_graphic(kbdintr,0));
  257.           while(nap_msec > 0)
  258.           {
  259. !             nap_msec -= nap(100L);
  260.               while(rdchk(0))
  261.               {
  262.                   ans = to_lower(ttygetc(1));
  263.  
  264. --- 849,855 -----
  265.               delay,(kbdintr == DEL) ?"DEL":make_char_graphic(kbdintr,0));
  266.           while(nap_msec > 0)
  267.           {
  268. !             nap_msec -= Nap(100L);
  269.               while(rdchk(0))
  270.               {
  271.                   ans = to_lower(ttygetc(1));
  272. ***************
  273. *** 1014,1020
  274.   {
  275.       if(!Lmodem_autoans[0])
  276.           return;
  277. !     (void)nap(200L);
  278.       lputs_paced(20,"AT\r");
  279.       (void)nap(100L);
  280.       lputs_paced(20,Lmodem_autoans); /* quiet modem */
  281.  
  282. --- 1014,1020 -----
  283.   {
  284.       if(!Lmodem_autoans[0])
  285.           return;
  286. !     (void)Nap(200L);
  287.       lputs_paced(20,"AT\r");
  288.       (void)Nap(100L);
  289.       lputs_paced(20,Lmodem_autoans); /* quiet modem */
  290. ***************
  291. *** 1016,1022
  292.           return;
  293.       (void)nap(200L);
  294.       lputs_paced(20,"AT\r");
  295. !     (void)nap(100L);
  296.       lputs_paced(20,Lmodem_autoans); /* quiet modem */
  297.       lputs_paced(20,"\r");
  298.       (void)nap(200L);
  299.  
  300. --- 1016,1022 -----
  301.           return;
  302.       (void)Nap(200L);
  303.       lputs_paced(20,"AT\r");
  304. !     (void)Nap(100L);
  305.       lputs_paced(20,Lmodem_autoans); /* quiet modem */
  306.       lputs_paced(20,"\r");
  307.       (void)Nap(200L);
  308. ***************
  309. *** 1019,1025
  310.       (void)nap(100L);
  311.       lputs_paced(20,Lmodem_autoans); /* quiet modem */
  312.       lputs_paced(20,"\r");
  313. !     (void)nap(200L);
  314.       lputs_paced(20,Lmodem_autoans); /* quiet modem */
  315.       lputs_paced(20,"\r");
  316.       (void)nap(200L);
  317.  
  318. --- 1019,1025 -----
  319.       (void)Nap(100L);
  320.       lputs_paced(20,Lmodem_autoans); /* quiet modem */
  321.       lputs_paced(20,"\r");
  322. !     (void)Nap(200L);
  323.       lputs_paced(20,Lmodem_autoans); /* quiet modem */
  324.       lputs_paced(20,"\r");
  325.       (void)Nap(200L);
  326. ***************
  327. *** 1022,1028
  328.       (void)nap(200L);
  329.       lputs_paced(20,Lmodem_autoans); /* quiet modem */
  330.       lputs_paced(20,"\r");
  331. !     (void)nap(200L);
  332.       lflush(0);
  333.   }    /* end of DCE_autoanswer */
  334.   
  335.  
  336. --- 1022,1028 -----
  337.       (void)Nap(200L);
  338.       lputs_paced(20,Lmodem_autoans); /* quiet modem */
  339.       lputs_paced(20,"\r");
  340. !     (void)Nap(200L);
  341.       lflush(0);
  342.   }    /* end of DCE_autoanswer */
  343.   
  344. *** /u1/src/ecu311/ecufinsert.c    Thu Jul 25 12:55:00 1991
  345. --- ecufinsert.c    Tue Aug 13 13:50:42 1991
  346. ***************
  347. *** 220,226
  348.               while(*cptr)
  349.               {
  350.                   lputc(*cptr++);
  351. !                 nap(20L);
  352.                   while(rdchk(shm->Liofd))
  353.                   {
  354.                       rchar = lgetc_xmtr();
  355.  
  356. --- 220,226 -----
  357.               while(*cptr)
  358.               {
  359.                   lputc(*cptr++);
  360. !                 Nap(20L);
  361.                   while(rdchk(shm->Liofd))
  362.                   {
  363.                       rchar = lgetc_xmtr();
  364. ***************
  365. *** 233,239
  366.           if(xmit_cr)
  367.           {
  368.               if(xmit_mode == 'p')
  369. !                 nap(20L);
  370.               lputc('\r');
  371.               xmit_len++;
  372.           }
  373.  
  374. --- 233,239 -----
  375.           if(xmit_cr)
  376.           {
  377.               if(xmit_mode == 'p')
  378. !                 Nap(20L);
  379.               lputc('\r');
  380.               xmit_len++;
  381.           }
  382. *** /u1/src/ecu311/ecufork.c    Thu Jul 25 12:55:00 1991
  383. --- ecufork.c    Tue Aug 13 13:50:43 1991
  384. ***************
  385. *** 38,44
  386.           if((pid = fork()) >= 0)
  387.               return(pid);
  388.           if(count)
  389. !             nap(40L);
  390.       }
  391.       return(-1);
  392.   }    /* end of smart_fork */
  393.  
  394. --- 38,44 -----
  395.           if((pid = fork()) >= 0)
  396.               return(pid);
  397.           if(count)
  398. !             Nap(40L);
  399.       }
  400.       return(-1);
  401.   }    /* end of smart_fork */
  402. *** /u1/src/ecu311/ecuicmhist.c    Tue Aug 13 15:53:09 1991
  403. --- ecuicmhist.c    Tue Aug 13 15:25:25 1991
  404. ***************
  405. *** 106,117
  406.   register ICMDH *icmdh = icmdh_tail;
  407.   uchar delim;
  408.   
  409. -     if((func != XFcurup) && (func != XFhome))
  410. -     {
  411. -         ring_bell();
  412. -         return(1);
  413. -     }
  414.       if(!icmdh)
  415.       {
  416.           ff(se,"no interactive commands saved\r\n");
  417.  
  418. --- 106,111 -----
  419.   register ICMDH *icmdh = icmdh_tail;
  420.   uchar delim;
  421.   
  422.       if(!icmdh)
  423.       {
  424.           ff(se,"  no interactive commands saved\r\n");
  425. ***************
  426. *** 114,120
  427.   
  428.       if(!icmdh)
  429.       {
  430. !         ff(se,"no interactive commands saved\r\n");
  431.           return(1);
  432.       }
  433.       while(1)
  434.  
  435. --- 108,114 -----
  436.   
  437.       if(!icmdh)
  438.       {
  439. !         ff(se,"  no interactive commands saved\r\n");
  440.           return(1);
  441.       }
  442.       while(1)
  443. *** /u1/src/ecu311/eculine.c    Tue Aug 13 15:53:10 1991
  444. --- eculine.c    Tue Aug 13 13:50:44 1991
  445. ***************
  446. *** 192,198
  447.   int delim_len;
  448.   long quantum;
  449.   long ltmp;
  450. ! long nap();
  451.   
  452.       delim_len = (lrwt->delim) ? strlen(lrwt->delim) : 0;
  453.   
  454.  
  455. --- 192,198 -----
  456.   int delim_len;
  457.   long quantum;
  458.   long ltmp;
  459. ! long Nap();
  460.   
  461.       delim_len = (lrwt->delim) ? strlen(lrwt->delim) : 0;
  462.   
  463. ***************
  464. *** 239,245
  465.       *cptr = 0;                    /* init result string */
  466.       while(timeout_counter--)
  467.       {
  468. !         nap(quantum);
  469.   
  470.           if(check_sigint && sigint)
  471.               goto INTERRUPTED;
  472.  
  473. --- 239,245 -----
  474.       *cptr = 0;                    /* init result string */
  475.       while(timeout_counter--)
  476.       {
  477. !         Nap(quantum);
  478.   
  479.           if(check_sigint && sigint)
  480.               goto INTERRUPTED;
  481. ***************
  482. *** 410,416
  483.   {
  484.   uchar rtn_char;
  485.   #if defined(NO_SELECT)
  486. ! long nap();
  487.   long timeout;
  488.   
  489.   AGAIN:
  490.  
  491. --- 410,416 -----
  492.   {
  493.   uchar rtn_char;
  494.   #if defined(NO_SELECT)
  495. ! long Nap();
  496.   long timeout;
  497.   
  498.   AGAIN:
  499. ***************
  500. *** 419,425
  501.       {
  502.           if(sigint)
  503.               return(-1);
  504. !         if((timeout -= nap(hzmsec)) <= 0)
  505.               return(-1);
  506.       }
  507.   
  508.  
  509. --- 419,425 -----
  510.       {
  511.           if(sigint)
  512.               return(-1);
  513. !         if((timeout -= Nap(hzmsec)) <= 0)
  514.               return(-1);
  515.       }
  516.   
  517. ***************
  518. *** 595,601
  519.   {
  520.   
  521.       lputc(lchar);    
  522. !     nap((long)(pace_msec ? pace_msec : LPUTS_NAP_COUNT));
  523.   
  524.   }    /* end of lputc_paced */
  525.   
  526.  
  527. --- 595,601 -----
  528.   {
  529.   
  530.       lputc(lchar);    
  531. !     Nap((long)(pace_msec ? pace_msec : LPUTS_NAP_COUNT));
  532.   
  533.   }    /* end of lputc_paced */
  534.   
  535. ***************
  536. *** 937,943
  537.       b0t.c_cflag &= ~CBAUD;
  538.   
  539.       ioctl(shm->Liofd,TCSETA,(char *)&b0t);        /* drop DTR */
  540. !     nap(1000L);
  541.       ioctl(shm->Liofd,TCSETA,(char *)&Ltermio);    /* raise DTR */
  542.       nap(300L);
  543.   
  544.  
  545. --- 937,943 -----
  546.       b0t.c_cflag &= ~CBAUD;
  547.   
  548.       ioctl(shm->Liofd,TCSETA,(char *)&b0t);        /* drop DTR */
  549. !     Nap(1000L);
  550.       ioctl(shm->Liofd,TCSETA,(char *)&Ltermio);    /* raise DTR */
  551.       Nap(300L);
  552.   
  553. ***************
  554. *** 939,945
  555.       ioctl(shm->Liofd,TCSETA,(char *)&b0t);        /* drop DTR */
  556.       nap(1000L);
  557.       ioctl(shm->Liofd,TCSETA,(char *)&Ltermio);    /* raise DTR */
  558. !     nap(300L);
  559.   
  560.   }    /* end of ltoggle_dtr */
  561.   
  562.  
  563. --- 939,945 -----
  564.       ioctl(shm->Liofd,TCSETA,(char *)&b0t);        /* drop DTR */
  565.       Nap(1000L);
  566.       ioctl(shm->Liofd,TCSETA,(char *)&Ltermio);    /* raise DTR */
  567. !     Nap(300L);
  568.   
  569.   }    /* end of ltoggle_dtr */
  570.   
  571. *** /u1/src/ecu311/ecuphone.c    Tue Aug 13 15:53:12 1991
  572. --- ecuphone.c    Tue Aug 13 13:50:44 1991
  573. ***************
  574. *** 491,497
  575.                   {
  576.                       dirw_bot_msg("created new (empty) directory file");
  577.                       ring_bell();
  578. !                     nap(1000L);
  579.                   }
  580.                   goto TRY_OPEN;
  581.               }
  582.  
  583. --- 491,497 -----
  584.                   {
  585.                       dirw_bot_msg("created new (empty) directory file");
  586.                       ring_bell();
  587. !                     Nap(1000L);
  588.                   }
  589.                   goto TRY_OPEN;
  590.               }
  591. ***************
  592. *** 1700,1706
  593.                   close(itmp);
  594.                   dirw_bot_msg("created new (empty) directory file");
  595.                   ring_bell();
  596. !                 nap(1000L);
  597.                   goto READ_LIST;
  598.               }
  599.               if(errno == ENOENT)
  600.  
  601. --- 1700,1706 -----
  602.                   close(itmp);
  603.                   dirw_bot_msg("created new (empty) directory file");
  604.                   ring_bell();
  605. !                 Nap(1000L);
  606.                   goto READ_LIST;
  607.               }
  608.               if(errno == ENOENT)
  609. ***************
  610. *** 1836,1842
  611.                           (kbdintr == DEL) ?"DEL":make_char_graphic(kbdintr,0));
  612.                       while(nap_decisec--)
  613.                       {
  614. !                         nap(100L);
  615.                           if(rdchk(0))
  616.                           {
  617.                               ans = to_lower(ttygetc(1));
  618.  
  619. --- 1836,1842 -----
  620.                           (kbdintr == DEL) ?"DEL":make_char_graphic(kbdintr,0));
  621.                       while(nap_decisec--)
  622.                       {
  623. !                         Nap(100L);
  624.                           if(rdchk(0))
  625.                           {
  626.                               ans = to_lower(ttygetc(1));
  627. *** /u1/src/ecu311/ecuphrase.c    Thu Jul 25 12:56:00 1991
  628. --- ecuphrase.c    Tue Aug 13 13:50:45 1991
  629. ***************
  630. *** 196,202
  631.                                       cptr++;
  632.                                   if(!itmp)
  633.                                       itmp = 1;
  634. !                                 nap((long)itmp * 100L);
  635.                                   break;
  636.                               case 'a':
  637.                                   itmp = atoi(cptr);
  638.  
  639. --- 196,202 -----
  640.                                       cptr++;
  641.                                   if(!itmp)
  642.                                       itmp = 1;
  643. !                                 Nap((long)itmp * 100L);
  644.                                   break;
  645.                               case 'a':
  646.                                   itmp = atoi(cptr);
  647. *** /u1/src/ecu311/ecuscrdump.c    Thu Jul 25 12:56:00 1991
  648. --- ecuscrdump.c    Tue Aug 13 13:50:45 1991
  649. ***************
  650. *** 85,91
  651.           xbell(XBELL_DONE,1);
  652.   #else
  653.           ring_bell();
  654. !         nap(50L);
  655.           ring_bell();
  656.   #endif
  657.           return;
  658.  
  659. --- 85,91 -----
  660.           xbell(XBELL_DONE,1);
  661.   #else
  662.           ring_bell();
  663. !         Nap(50L);
  664.           ring_bell();
  665.   #endif
  666.           return;
  667. ***************
  668. *** 104,110
  669.           {
  670.               if(!rdchk(0))
  671.               {
  672. !                 nap(hzmsec * 3);
  673.                   if(!rdchk(0))
  674.                       break;
  675.               }
  676.  
  677. --- 104,110 -----
  678.           {
  679.               if(!rdchk(0))
  680.               {
  681. !                 Nap(hzmsec * 3);
  682.                   if(!rdchk(0))
  683.                       break;
  684.               }
  685. *** /u1/src/ecu311/ecusetup.c    Tue Aug 13 15:53:14 1991
  686. --- ecusetup.c    Tue Aug 13 13:50:45 1991
  687. ***************
  688. *** 387,393
  689.           setw_err_msg(cptr);
  690.           if(!retries--)
  691.               break;
  692. !         nap(1000L);
  693.           setw_err_msg("");
  694.       }
  695.       setup_open_status();
  696.  
  697. --- 387,393 -----
  698.           setw_err_msg(cptr);
  699.           if(!retries--)
  700.               break;
  701. !         Nap(1000L);
  702.           setw_err_msg("");
  703.       }
  704.       setup_open_status();
  705. *** /u1/src/ecu311/ecusighdl.c    Thu Jul 25 12:56:00 1991
  706. --- ecusighdl.c    Tue Aug 13 13:50:46 1991
  707. ***************
  708. *** 153,159
  709.                   if(kill(rcvr_pid,0) && (errno == ESRCH))
  710.                       break;
  711.                   errno = 0;
  712. !                 nap(40L);
  713.                   wait_count--;
  714.               }
  715.               if(!wait_count)
  716.  
  717. --- 153,159 -----
  718.                   if(kill(rcvr_pid,0) && (errno == ESRCH))
  719.                       break;
  720.                   errno = 0;
  721. !                 Nap(40L);
  722.                   wait_count--;
  723.               }
  724.               if(!wait_count)
  725. ***************
  726. *** 161,167
  727.                   while(!kill(rcvr_pid,SIGKILL))
  728.                   {
  729.                       wait((int *)0);
  730. !                     nap(40L);
  731.                   }
  732.               }
  733.               rcvr_pid = -1;
  734.  
  735. --- 161,167 -----
  736.                   while(!kill(rcvr_pid,SIGKILL))
  737.                   {
  738.                       wait((int *)0);
  739. !                     Nap(40L);
  740.                   }
  741.               }
  742.               rcvr_pid = -1;
  743. *** /u1/src/ecu311/ecutty.c    Thu Jul 25 12:57:00 1991
  744. --- ecutty.c    Tue Aug 13 14:55:55 1991
  745. ***************
  746. *** 797,802
  747.       {
  748.           itmp = 0;
  749.           timeout_remaining = tty_escape_timeout;
  750.           while((!isalpha(ctmp)) && (itmp < sizeof(tgc_accum) - 1) &&
  751.               (timeout_remaining > 0))
  752.           {
  753.  
  754. --- 797,806 -----
  755.       {
  756.           itmp = 0;
  757.           timeout_remaining = tty_escape_timeout;
  758. + #if defined(NAP_DEBUG)
  759. +         ff(se,"timeout_remaining = %ld hzmsec=%ld\r\n",
  760. +             timeout_remaining,hzmsec);
  761. + #endif
  762.           while((!isalpha(ctmp)) && (itmp < sizeof(tgc_accum) - 1) &&
  763.               (timeout_remaining > 0))
  764.           {
  765. ***************
  766. *** 800,806
  767.           while((!isalpha(ctmp)) && (itmp < sizeof(tgc_accum) - 1) &&
  768.               (timeout_remaining > 0))
  769.           {
  770. !             timeout_remaining -= nap(hzmsec);
  771.               if(!rdchk(TTYIN))
  772.                   continue;
  773.               read(TTYIN,(char *)&ctmp,1);
  774.  
  775. --- 804,813 -----
  776.           while((!isalpha(ctmp)) && (itmp < sizeof(tgc_accum) - 1) &&
  777.               (timeout_remaining > 0))
  778.           {
  779. !             timeout_remaining -= Nap(hzmsec);
  780. ! #if defined(NAP_DEBUG)
  781. !             ff(se,"timeout_remaining = %ld\r\n",timeout_remaining);
  782. ! #endif
  783.               if(!rdchk(TTYIN))
  784.                   continue;
  785.               read(TTYIN,(char *)&ctmp,1);
  786. ***************
  787. *** 849,854
  788.           tgc_accum[0] = ctmp;
  789.           tgc_accum[itmp = 1] = 0;
  790.           timeout_remaining = tty_escape_timeout;
  791.           while(((ctmp = map_nonansi_key(tgc_accum,itmp)) >= XF_no_way) &&
  792.               (timeout_remaining > 0))
  793.           {
  794.  
  795. --- 856,865 -----
  796.           tgc_accum[0] = ctmp;
  797.           tgc_accum[itmp = 1] = 0;
  798.           timeout_remaining = tty_escape_timeout;
  799. + #if defined(NAP_DEBUG)
  800. +         ff(se,"timeout_remaining = %ld hzmsec=%ld\r\n",
  801. +             timeout_remaining,hzmsec);
  802. + #endif
  803.           while(((ctmp = map_nonansi_key(tgc_accum,itmp)) >= XF_no_way) &&
  804.               (timeout_remaining > 0))
  805.           {
  806. ***************
  807. *** 852,858
  808.           while(((ctmp = map_nonansi_key(tgc_accum,itmp)) >= XF_no_way) &&
  809.               (timeout_remaining > 0))
  810.           {
  811. !             timeout_remaining -= nap(hzmsec);
  812.               if(!rdchk(TTYIN))
  813.                   continue;
  814.               read(TTYIN,(char *)&ctmp,1);
  815.  
  816. --- 863,872 -----
  817.           while(((ctmp = map_nonansi_key(tgc_accum,itmp)) >= XF_no_way) &&
  818.               (timeout_remaining > 0))
  819.           {
  820. !             timeout_remaining -= Nap(hzmsec);
  821. ! #if defined(NAP_DEBUG)
  822. !             ff(se,"timeout_remaining = %ld\r\n",timeout_remaining);
  823. ! #endif
  824.               if(!rdchk(TTYIN))
  825.                   continue;
  826.               read(TTYIN,(char *)&ctmp,1);
  827. *** /u1/src/ecu311/ecuutil.c    Tue Aug 13 15:53:15 1991
  828. --- ecuutil.c    Tue Aug 13 15:04:29 1991
  829. ***************
  830. *** 3,8
  831.       wht@n4hgf.Mt-Park.GA.US
  832.   
  833.     Defined functions:
  834.       arg_token(parsestr,termchars)
  835.       ascii_name_to_hex(str3char)
  836.       ascii_to_hex(ascii)
  837.  
  838. --- 3,9 -----
  839.       wht@n4hgf.Mt-Park.GA.US
  840.   
  841.     Defined functions:
  842. +     Nap(msec)
  843.       arg_token(parsestr,termchars)
  844.       ascii_name_to_hex(str3char)
  845.       ascii_to_hex(ascii)
  846. ***************
  847. *** 8,13
  848.       ascii_to_hex(ascii)
  849.       build_arg_array(cmd,arg,arg_max_quan,narg_rtn)
  850.       build_str_array(str,arg,str_max_quan,nstr_rtn)
  851.       disp_line_termio(fd,text)
  852.       disp_stat(st)
  853.       disp_termio(ttt,text)
  854.  
  855. --- 9,16 -----
  856.       ascii_to_hex(ascii)
  857.       build_arg_array(cmd,arg,arg_max_quan,narg_rtn)
  858.       build_str_array(str,arg,str_max_quan,nstr_rtn)
  859. +     cfree(p,num,size)
  860. +     defeat_optimize_to_work_around_bug(would_be_optimized)
  861.       disp_line_termio(fd,text)
  862.       disp_stat(st)
  863.       disp_termio(ttt,text)
  864. ***************
  865. *** 11,17
  866.       disp_line_termio(fd,text)
  867.       disp_stat(st)
  868.       disp_termio(ttt,text)
  869. !     errno_text(errno)
  870.       find_shell_chars(command)
  871.       get_curr_dir(cdir,cdir_max)
  872.       get_home_dir(home_dir)
  873.  
  874. --- 14,20 -----
  875.       disp_line_termio(fd,text)
  876.       disp_stat(st)
  877.       disp_termio(ttt,text)
  878. !     errno_text(err_no)
  879.       find_shell_chars(command)
  880.       get_curr_dir(cdir,cdir_max)
  881.       get_home_dir(home_dir)
  882. ***************
  883. *** 17,23
  884.       get_home_dir(home_dir)
  885.       hex_to_ascii_name(char_val)
  886.       make_char_graphic(ch,incl_3char)
  887. -     make_dirs(pathname)
  888.       make_ecu_subdir()
  889.       mem_cpy(dest,src,len);
  890.       mkdir(dpath,dmode)
  891.  
  892. --- 20,25 -----
  893.       get_home_dir(home_dir)
  894.       hex_to_ascii_name(char_val)
  895.       make_char_graphic(ch,incl_3char)
  896.       make_ecu_subdir()
  897.       mem_cpy(dest,src,len)
  898.       mode_map(mode,mode_str)
  899. ***************
  900. *** 19,26
  901.       make_char_graphic(ch,incl_3char)
  902.       make_dirs(pathname)
  903.       make_ecu_subdir()
  904. !     mem_cpy(dest,src,len);
  905. !     mkdir(dpath,dmode)
  906.       mode_map(mode,mode_str)
  907.       pad_zstr_to_len(zstr,len)
  908.       perror_errmsg(str)
  909.  
  910. --- 21,27 -----
  911.       hex_to_ascii_name(char_val)
  912.       make_char_graphic(ch,incl_3char)
  913.       make_ecu_subdir()
  914. !     mem_cpy(dest,src,len)
  915.       mode_map(mode,mode_str)
  916.       pad_zstr_to_len(zstr,len)
  917.       perror_errmsg(str)
  918. ***************
  919. *** 27,32
  920.       print_cwd(curdir,buf_size)
  921.       skip_ld_break(zstr)
  922.       str_token(parsestr,termchars)
  923.       yes_or_no(strarg)
  924.   
  925.   ------------------------------------------------------------------------*/
  926.  
  927. --- 28,34 -----
  928.       print_cwd(curdir,buf_size)
  929.       skip_ld_break(zstr)
  930.       str_token(parsestr,termchars)
  931. +     strip_trail_break(zstr)
  932.       yes_or_no(strarg)
  933.   
  934.   ------------------------------------------------------------------------*/
  935. ***************
  936. *** 31,36
  937.   
  938.   ------------------------------------------------------------------------*/
  939.   /*+:EDITS:*/
  940.   /*:07-25-1991-12:57-wht@n4hgf-ECU release 3.10 */
  941.   /*:04-16-1991-15:45-wht@n4hgf-gcc cannot use memmove */
  942.   /*:03-18-1991-22:31-wht@n4hgf-ISC 2.2 has mkdir() */
  943.  
  944. --- 33,39 -----
  945.   
  946.   ------------------------------------------------------------------------*/
  947.   /*+:EDITS:*/
  948. + /*:08-13-1991-13:53-wht@n4hgf-UNIX and ISC nap() broken; XENIX still wins */
  949.   /*:07-25-1991-12:57-wht@n4hgf-ECU release 3.10 */
  950.   /*:04-16-1991-15:45-wht@n4hgf-gcc cannot use memmove */
  951.   /*:03-18-1991-22:31-wht@n4hgf-ISC 2.2 has mkdir() */
  952. ***************
  953. *** 980,984
  954.   }    /* end of defeat_optimize_to_work_around_bug */
  955.   
  956.   #endif /* __GNUC__ */
  957.   /* end of ecuutil.c */
  958.   /* vi: set tabstop=4 shiftwidth=4: */
  959.  
  960. --- 983,1056 -----
  961.   }    /* end of defeat_optimize_to_work_around_bug */
  962.   
  963.   #endif /* __GNUC__ */
  964. + /*+-------------------------------------------------------------------------
  965. +     Nap(msec) - wrapper for nap()
  966. + ISC and SCO UNIX nap() misbehave.  This kludge doesn't return the
  967. + proper value (the actual time slept), but at least it does not make
  968. + a mockery of the manual page.  It says:
  969. +      NAP(S)               UNIX System V            NAP(S)
  970. +      Name
  971. +       nap -    suspends execution for a short interval
  972. +      Syntax
  973. +       long nap(period)
  974. +       long period;
  975. +      Description
  976. +       The current process is suspended from    execution for at least
  977. +       the number of    milliseconds specified by period, or until a
  978. +       signal is received.
  979. +      Return Value
  980. +       On successful    completion, a long integer indicating the
  981. +       number of milliseconds actually slept    is returned. If    the
  982. +       process received a signal while napping, the return value
  983. +       will be -1, and errno    will be    set to EINTR.
  984. +      See Also
  985. +       sleep(S)
  986. +      Notes
  987. +       This function    is driven by the system    clock, which in    most
  988. +       cases    has a granularity of tens of milliseconds.  This
  989. +       function must    be linked with the linker option -lx.
  990. + It appears nap() under UNIX 3.2.x has departed virtually entirely from
  991. + the manual page.  I'm beginning to look rather silly in several
  992. + milleus since I keep telling people SCO UNIX is a viable upgrade from
  993. + XENIX.  But process control people need some kind of timing capability
  994. + less than one second and we can't do it with nap or select.
  995. + nap(msec) is supposed to nap *at least* msec milliseconds.  However,
  996. + if msec is specified less than 1000/HZ + 1, it will not nap at all.
  997. + This was true for 3.2.0 and 3.2.1.
  998. + It is supposed to return the number of milliseconds it actually
  999. + slept.  Instead, it appears to "save up" the values and return them in
  1000. + lots of 1000. This behavior is true for 3.2.2.
  1001. + As it is nap() is nearly useless.  I believe select() suffers
  1002. + from the same deficiency (< 1000 msec timeout becomes 1000 msec) but
  1003. + I haven't "proven" it yet.
  1004. + --------------------------------------------------------------------------*/
  1005. + long
  1006. + Nap(msec)
  1007. + long msec;
  1008. + {
  1009. + #if defined(M_XENIX) || defined(WORKING_UNIX_NAP)
  1010. +     return(nap(msec));
  1011. + #else
  1012. +     if(msec < hzmsec)
  1013. +         msec = hzmsec;
  1014. +     if(nap(msec) < 0)
  1015. +         return(-1);
  1016. +     return(msec);
  1017. + #endif
  1018. + }    /* end of Nap */
  1019.   /* end of ecuutil.c */
  1020.   /* vi: set tabstop=4 shiftwidth=4: */
  1021. *** /u1/src/ecu311/ecuxenix.c    Thu Jul 25 12:57:00 1991
  1022. --- ecuxenix.c    Tue Aug 13 15:28:52 1991
  1023. ***************
  1024. *** 20,25
  1025.     This module is a grab bag for historical reasons.  Needs reorg.
  1026.   ------------------------------------------------------------------*/
  1027.   /*+:EDITS:*/
  1028.   /*:07-25-1991-12:57-wht@n4hgf-ECU release 3.10 */
  1029.   /*:07-17-1991-07:04-wht@n4hgf-avoid SCO UNIX nap bug */
  1030.   /*:07-14-1991-18:18-wht@n4hgf-new ttygets functions */
  1031.  
  1032. --- 20,26 -----
  1033.     This module is a grab bag for historical reasons.  Needs reorg.
  1034.   ------------------------------------------------------------------*/
  1035.   /*+:EDITS:*/
  1036. + /*:08-13-1991-15:28-wht@n4hgf-more problems with history manager */
  1037.   /*:07-25-1991-12:57-wht@n4hgf-ECU release 3.10 */
  1038.   /*:07-17-1991-07:04-wht@n4hgf-avoid SCO UNIX nap bug */
  1039.   /*:07-14-1991-18:18-wht@n4hgf-new ttygets functions */
  1040. ***************
  1041. *** 163,169
  1042.               switch(delim)
  1043.               {
  1044.                   case XFhome:
  1045. -                 case XFend:
  1046.                   case XFpgup:
  1047.                   case XFpgdn:
  1048.                   case XFcurup:
  1049.  
  1050. --- 164,169 -----
  1051.               switch(delim)
  1052.               {
  1053.                   case XFhome:
  1054.                   case XFpgup:
  1055.                   case XFcurup:
  1056.                       if(icmd_history_manager(delim,icmd_buf,sizeof(icmd_buf)))
  1057. ***************
  1058. *** 165,171
  1059.                   case XFhome:
  1060.                   case XFend:
  1061.                   case XFpgup:
  1062. -                 case XFpgdn:
  1063.                   case XFcurup:
  1064.                   case XFcurdn:
  1065.                       if(icmd_history_manager(delim,icmd_buf,sizeof(icmd_buf)))
  1066.  
  1067. --- 165,170 -----
  1068.               {
  1069.                   case XFhome:
  1070.                   case XFpgup:
  1071.                   case XFcurup:
  1072.                       if(icmd_history_manager(delim,icmd_buf,sizeof(icmd_buf)))
  1073.                       {
  1074. ***************
  1075. *** 167,173
  1076.                   case XFpgup:
  1077.                   case XFpgdn:
  1078.                   case XFcurup:
  1079. -                 case XFcurdn:
  1080.                       if(icmd_history_manager(delim,icmd_buf,sizeof(icmd_buf)))
  1081.                       {
  1082.                           ring_bell();
  1083.  
  1084. --- 166,171 -----
  1085.                   case XFhome:
  1086.                   case XFpgup:
  1087.                   case XFcurup:
  1088.                       if(icmd_history_manager(delim,icmd_buf,sizeof(icmd_buf)))
  1089.                       {
  1090.                           ring_bell();
  1091. ***************
  1092. *** 174,179
  1093.                           ttygets_flags |= 4;
  1094.                           goto GET_ICMD;
  1095.                       }
  1096.                   case ESC:
  1097.                   case NL:
  1098.                       break;
  1099.  
  1100. --- 172,178 -----
  1101.                           ttygets_flags |= 4;
  1102.                           goto GET_ICMD;
  1103.                       }
  1104. +                     break;
  1105.                   case ESC:
  1106.                   case NL:
  1107.                       break;
  1108. ***************
  1109. *** 179,184
  1110.                       break;
  1111.                   default:
  1112.                       ring_bell();
  1113.                       ttygets_flags |= 4;
  1114.                       goto GET_ICMD;
  1115.               }
  1116.  
  1117. --- 178,186 -----
  1118.                       break;
  1119.                   default:
  1120.                       ring_bell();
  1121. +                     itmp = strlen((char *)icmd_buf);
  1122. +                     while(itmp--)
  1123. +                         ff(se,"\b \b");
  1124.                       ttygets_flags |= 4;
  1125.                       goto GET_ICMD;
  1126.               }
  1127. ***************
  1128. *** 265,271
  1129.           while(count--)
  1130.           {
  1131.               write(fd,&bellch,1);    
  1132. !             nap((long)nap_msec);
  1133.           }
  1134.       }
  1135.   }    /* end of send_bell_fd */
  1136.  
  1137. --- 267,273 -----
  1138.           while(count--)
  1139.           {
  1140.               write(fd,&bellch,1);    
  1141. !             Nap((long)nap_msec);
  1142.           }
  1143.       }
  1144.   }    /* end of send_bell_fd */
  1145. *** /u1/src/ecu311/ecuxfer.c    Thu Jul 25 12:57:00 1991
  1146. --- ecuxfer.c    Tue Aug 13 13:50:47 1991
  1147. ***************
  1148. *** 988,994
  1149.       }
  1150.       lreset_ksr();
  1151.       file_xfer_done_bell();
  1152. !     nap(20L);
  1153.       start_rcvr_process(1);
  1154.   }    /* end of receive_files_from_remote */
  1155.   /* end of ecuxfer.c */
  1156.  
  1157. --- 988,994 -----
  1158.       }
  1159.       lreset_ksr();
  1160.       file_xfer_done_bell();
  1161. !     Nap(20L);
  1162.       start_rcvr_process(1);
  1163.   }    /* end of receive_files_from_remote */
  1164.   /* end of ecuxfer.c */
  1165. *** /u1/src/ecu311/expresp.c    Tue Aug 13 15:53:17 1991
  1166. --- expresp.c    Tue Aug 13 13:50:48 1991
  1167. ***************
  1168. *** 247,253
  1169.               {
  1170.                   case 'p':  /* pause (approximately 1/4-1/2 second delay) */
  1171.                       ldraino(0);    /* wait for output to drain */
  1172. !                     nap(400L);
  1173.                       break;
  1174.                   case 'm':  /* nap a while (non-standard) */
  1175.                       ltmp = atol(str + 1);
  1176.  
  1177. --- 247,253 -----
  1178.               {
  1179.                   case 'p':  /* pause (approximately 1/4-1/2 second delay) */
  1180.                       ldraino(0);    /* wait for output to drain */
  1181. !                     Nap(400L);
  1182.                       break;
  1183.                   case 'm':  /* nap a while (non-standard) */
  1184.                       ltmp = atol(str + 1);
  1185. ***************
  1186. *** 253,259
  1187.                       ltmp = atol(str + 1);
  1188.                       str += strspn(str + 1,"0123456789");
  1189.                       ldraino(0);    /* wait for output to drain */
  1190. !                     nap((ltmp < hzmsec) ? hzmsec : ltmp);
  1191.                       break;
  1192.                   case 'd':  /* delay (2 seconds) */
  1193.                       ldraino(0);    /* wait for output to drain */
  1194.  
  1195. --- 253,259 -----
  1196.                       ltmp = atol(str + 1);
  1197.                       str += strspn(str + 1,"0123456789");
  1198.                       ldraino(0);    /* wait for output to drain */
  1199. !                     Nap((ltmp < hzmsec) ? hzmsec : ltmp);
  1200.                       break;
  1201.                   case 'd':  /* delay (2 seconds) */
  1202.                       ldraino(0);    /* wait for output to drain */
  1203. ***************
  1204. *** 257,263
  1205.                       break;
  1206.                   case 'd':  /* delay (2 seconds) */
  1207.                       ldraino(0);    /* wait for output to drain */
  1208. !                     nap(2000L);
  1209.                       break;
  1210.                   case 'D':  /* phone number/token */
  1211.                       if(expresp_echo_check)
  1212.  
  1213. --- 257,263 -----
  1214.                       break;
  1215.                   case 'd':  /* delay (2 seconds) */
  1216.                       ldraino(0);    /* wait for output to drain */
  1217. !                     Nap(2000L);
  1218.                       break;
  1219.                   case 'D':  /* phone number/token */
  1220.                       if(expresp_echo_check)
  1221. ***************
  1222. *** 302,308
  1223.           if(expresp_echo_check)
  1224.           {
  1225.               ldraino(1);        /* wait for output to drain, then flush input */
  1226. !             nap(40L);        /* fake it */
  1227.           }
  1228.           str++;
  1229.       }
  1230.  
  1231. --- 302,308 -----
  1232.           if(expresp_echo_check)
  1233.           {
  1234.               ldraino(1);        /* wait for output to drain, then flush input */
  1235. !             Nap(40L);        /* fake it */
  1236.           }
  1237.           str++;
  1238.       }
  1239. *** /u1/src/ecu311/pcmd.c    Tue Aug 13 15:53:26 1991
  1240. --- pcmd.c    Tue Aug 13 13:50:49 1991
  1241. ***************
  1242. *** 692,698
  1243.               interval = hzmsec;        /* SCO nap bug */
  1244.           if(proctrace && (interval > 100))    /* short naps hurt by pprintf */
  1245.               pprintf("nap %ld msec\n",interval);
  1246. !         if(nap(interval) == -1)        /* EINTR is the only error returned ... */
  1247.           {                            /* but check anyway */
  1248.               if(errno == EINTR)
  1249.                   erc = eCONINT;
  1250.  
  1251. --- 692,698 -----
  1252.               interval = hzmsec;        /* SCO nap bug */
  1253.           if(proctrace && (interval > 100))    /* short naps hurt by pprintf */
  1254.               pprintf("nap %ld msec\n",interval);
  1255. !         if(Nap(interval) == -1)        /* EINTR is the only error returned ... */
  1256.           {                            /* but check anyway */
  1257.               if(errno == EINTR)
  1258.                   erc = eCONINT;
  1259.