/[LeafOK_CVS]/lbbs/src/bbs_net.c
ViewVC logotype

Diff of /lbbs/src/bbs_net.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.10 by sysadm, Tue Mar 22 13:36:13 2005 UTC Revision 1.13 by sysadm, Sat May 7 12:08:28 2005 UTC
# Line 252  bbsnet_connect (int n) Line 252  bbsnet_connect (int n)
252        timeout.tv_sec = TIME_OUT;        timeout.tv_sec = TIME_OUT;
253        timeout.tv_usec = 0;        timeout.tv_usec = 0;
254    
255        result = select (FD_SETSIZE, &testfds, (fd_set *) NULL,        result = SignalSafeSelect (FD_SETSIZE, &testfds, (fd_set *) NULL,
256                         (fd_set *) NULL, &timeout);                         (fd_set *) NULL, &timeout);
257    
258        switch (result)        if (result == 0)
259          {          {
         case 0:  
260            if (time (0) - BBS_last_access_tm >= MAX_DELAY_TIME)            if (time (0) - BBS_last_access_tm >= MAX_DELAY_TIME)
261              {              {
262                loop = 0;                loop = 0;
263              }              }
264            break;          }
265          case -1:        if (result < 0)
266            log_error ("select() error!\n");          {
267            break;            log_error ("select() error (%d) !\n", result);
268          default:            loop = 0;
269            }
270          if (result > 0)
271            {
272            if (FD_ISSET (0, &testfds))            if (FD_ISSET (0, &testfds))
273              {              {
274                len = read (0, buf, 255);                len = read (0, buf, 255);
275                if (len == 0)                if (len == 0)
276                  {                  {
277                    loop = 0;                    loop = 0;
                   break;  
278                  }                  }
279                write (sock, buf, len);                write (sock, buf, len);
280              }              }
# Line 283  bbsnet_connect (int n) Line 284  bbsnet_connect (int n)
284                if (len == 0)                if (len == 0)
285                  {                  {
286                    loop = 0;                    loop = 0;
                   break;  
287                  }                  }
288                write (1, buf, len);                write (1, buf, len);
289              }              }
           break;  
290            BBS_last_access_tm = time (0);            BBS_last_access_tm = time (0);
291          }          }
292      }      }
# Line 331  bbsnet_refresh () Line 330  bbsnet_refresh ()
330      ("¨t¨T¨T¨T¨T¨T¨T¨T¨T¨T¨T¨T¨T¨T¨T¨T¨T¨T¨T¨T¨T¨T¨T¨T¨T¨T¨T¨T¨T¨T¨T¨T¨T¨T¨T¨T¨T¨T¨T¨s");      ("¨t¨T¨T¨T¨T¨T¨T¨T¨T¨T¨T¨T¨T¨T¨T¨T¨T¨T¨T¨T¨T¨T¨T¨T¨T¨T¨T¨T¨T¨T¨T¨T¨T¨T¨T¨T¨T¨T¨T¨s");
331    moveto (23, 0);    moveto (23, 0);
332    prints (" [\x1b[1;32mCtrl+C\x1b[m]Í˳ö");    prints (" [\x1b[1;32mCtrl+C\x1b[m]Í˳ö");
333    
334    iflush ();    iflush ();
335    
336    return 0;    return 0;


Legend:
Removed lines/characters  
Changed lines/characters
  Added lines/characters

webmaster@leafok.com
ViewVC Help
Powered by ViewVC 1.3.0-beta1