]> jfr.im git - solanum.git/blobdiff - bandb/bandb.c
bandb/bandb: functions that call exit(3) should be marked noreturn, avoid sign overfl...
[solanum.git] / bandb / bandb.c
index 2a0f1a048e6c59f801982bd7e6fa6517ea8fa0a2..769f6fe437b6b6430dbf20f20830368f537b128f 100644 (file)
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include "setup.h"
-#include <ratbox_lib.h>
+#include <rb_lib.h>
 #include <stdio.h>
 #include "rsdb.h"
-#include "common.h"
+#include "ircd_defs.h"
 
 
 #define MAXPARA 10
@@ -236,6 +236,9 @@ parse_request(rb_helper *helper)
 }
 
 
+static void
+error_cb(rb_helper *helper) __attribute__((noreturn));
+
 static void
 error_cb(rb_helper *helper)
 {
@@ -255,7 +258,7 @@ dummy_handler(int sig)
 static void
 setup_signals(void)
 {
-#ifndef WINDOWS
+#ifndef _WIN32
        struct sigaction act;
 
        act.sa_flags = 0;
@@ -282,13 +285,16 @@ setup_signals(void)
 }
 
 
+static void
+db_error_cb(const char *errstr) __attribute__((noreturn));
+
 static void
 db_error_cb(const char *errstr)
 {
        char buf[256];
        snprintf(buf, sizeof(buf), "! :%s", errstr);
        rb_helper_write(bandb_helper, "%s", buf);
-       rb_sleep(2 << 30, 0);
+       rb_sleep(1 << 30, 0);
        exit(1);
 }