bmsd/bms.c

changeset 747
b6fbe6821468
parent 746
44d929ff268e
equal deleted inserted replaced
746:44d929ff268e 747:b6fbe6821468
29 #include "mysql.h" 29 #include "mysql.h"
30 #include "nodes.h" 30 #include "nodes.h"
31 #include "websocket.h" 31 #include "websocket.h"
32 32
33 33
34 int my_shutdown = FALSE; 34 int my_shutdown = false;
35 int debug = FALSE; 35 int debug = false;
36 static pid_t mypid; 36 static pid_t mypid;
37 char *Private_Path = NULL; /* Users data path */ 37 char *Private_Path = NULL; /* Users data path */
38 pthread_t ws_thread; 38 pthread_t ws_thread;
39 39
40 extern sys_config Config; 40 extern sys_config Config;
59 case SIGINT: syslog(LOG_NOTICE, "Keyboard interrupt, shutting down"); 59 case SIGINT: syslog(LOG_NOTICE, "Keyboard interrupt, shutting down");
60 break; 60 break;
61 case SIGTERM: syslog(LOG_NOTICE, "Got SIGTERM, shutting down"); 61 case SIGTERM: syslog(LOG_NOTICE, "Got SIGTERM, shutting down");
62 break; 62 break;
63 case SIGSEGV: syslog(LOG_NOTICE, "Got SIGSEGV, shutting down"); 63 case SIGSEGV: syslog(LOG_NOTICE, "Got SIGSEGV, shutting down");
64 my_shutdown = TRUE; 64 my_shutdown = true;
65 exit(SIGSEGV); 65 exit(SIGSEGV);
66 break; 66 break;
67 default: syslog(LOG_NOTICE, "die() on signal %d", onsig); 67 default: syslog(LOG_NOTICE, "die() on signal %d", onsig);
68 } 68 }
69 my_shutdown = TRUE; 69 my_shutdown = true;
70 } 70 }
71 71
72 72
73 73
74 /** 74 /**
182 } 182 }
183 183
184 if (debug) 184 if (debug)
185 fprintf(stdout, "[main] Entering main loop\n"); 185 fprintf(stdout, "[main] Entering main loop\n");
186 186
187 while (my_shutdown == FALSE) { 187 while (my_shutdown == false) {
188 188
189 usleep(3000000); 189 usleep(3000000);
190 nodes_check_online(); 190 nodes_check_online();
191 usleep(2000000); 191 usleep(2000000);
192 ws_check(); 192 ws_check();
233 233
234 c = getopt_long(argc, argv, "dh", long_options, &option_index); 234 c = getopt_long(argc, argv, "dh", long_options, &option_index);
235 if (c == -1) 235 if (c == -1)
236 break; 236 break;
237 switch (c) { 237 switch (c) {
238 case 'd': debug = TRUE; 238 case 'd': debug = true;
239 break; 239 break;
240 case 'h': help(); 240 case 'h': help();
241 return 1; 241 return 1;
242 } 242 }
243 } 243 }

mercurial