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

Diff of /lbbs/src/net_server.c

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

Revision 1.19 by sysadm, Fri May 9 11:21:11 2025 UTC Revision 1.21 by sysadm, Sat May 10 15:23:42 2025 UTC
# Line 23  Line 23 
23  #include "log.h"  #include "log.h"
24  #include "io.h"  #include "io.h"
25  #include "fork.h"  #include "fork.h"
 #include "tcplib.h"  
26  #include "menu.h"  #include "menu.h"
27    #include <errno.h>
28    #include <fcntl.h>
29    #include <string.h>
30  #include <signal.h>  #include <signal.h>
31    #include <stdlib.h>
32  #include <unistd.h>  #include <unistd.h>
33  #include <sys/syscall.h>  #include <sys/syscall.h>
34  #include <sys/socket.h>  #include <sys/socket.h>
# Line 108  int net_server(const char *hostaddr, in_ Line 111  int net_server(const char *hostaddr, in_
111                          }                          }
112                  }                  }
113    
114                  if (SYS_menu_reload)                  if (SYS_server_exit && SYS_child_exit_count == 0)
115                    {
116                            if (kill(0, SIGTERM) < 0)
117                            {
118                                    log_error("Send SIGTERM signal failed (%d)\n", errno);
119                            }
120                    }
121    
122                    if (SYS_menu_reload && !SYS_server_exit)
123                  {                  {
124                          if (reload_menu(&bbs_menu) < 0)                          if (reload_menu(&bbs_menu) < 0)
125                          {                          {
# Line 125  int net_server(const char *hostaddr, in_ Line 136  int net_server(const char *hostaddr, in_
136    
137                  FD_ZERO(&testfds);                  FD_ZERO(&testfds);
138                  FD_SET(socket_server, &testfds);                  FD_SET(socket_server, &testfds);
139            
140                  timeout.tv_sec = 1;                  timeout.tv_sec = 0;
141                  timeout.tv_usec = 0;                  timeout.tv_usec = 100 * 1000; // 0.1 second
142            
143                  ret = select(FD_SETSIZE, &testfds, NULL, NULL, &timeout);                  ret = select(FD_SETSIZE, &testfds, NULL, NULL, &timeout);
144    
145                  if (ret < 0)                  if (ret < 0)


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

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