X-Git-Url: https://jfr.im/git/solanum.git/blobdiff_plain/551241607041c874f24f5be43d0aa3210740ed08..5a3e99829addc0686ce9ddf372a3dc9d28b44269:/bandb/bandb.c?ds=sidebyside diff --git a/bandb/bandb.c b/bandb/bandb.c index 6731136b..85487447 100644 --- a/bandb/bandb.c +++ b/bandb/bandb.c @@ -26,14 +26,12 @@ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. - * - * $Id: bandb.c 26094 2008-09-19 15:33:46Z androsyn $ */ #include "setup.h" -#include +#include #include #include "rsdb.h" -#include "common.h" +#include "ircd_defs.h" #define MAXPARA 10 @@ -238,6 +236,9 @@ parse_request(rb_helper *helper) } +static void +error_cb(rb_helper *helper) __attribute__((noreturn)); + static void error_cb(rb_helper *helper) { @@ -246,18 +247,15 @@ error_cb(rb_helper *helper) exit(1); } -#ifndef WINDOWS static void dummy_handler(int sig) { return; } -#endif static void setup_signals(void) { -#ifndef WINDOWS struct sigaction act; act.sa_flags = 0; @@ -280,17 +278,19 @@ setup_signals(void) act.sa_handler = dummy_handler; sigaction(SIGALRM, &act, 0); -#endif } +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); } @@ -302,10 +302,9 @@ main(int argc, char *argv[]) if(bandb_helper == NULL) { fprintf(stderr, - "This is ircd-ratbox bandb. You aren't supposed to run me directly. Maybe you want bantool?\n"); + "This is the solanum bandb for internal ircd use.\n"); fprintf(stderr, - "However I will print my Id tag $Id: bandb.c 26094 2008-09-19 15:33:46Z androsyn $\n"); - fprintf(stderr, "Have a nice day\n"); + "You aren't supposed to run me directly (did you want solanum-bantool?). Exiting.\n"); exit(1); } rsdb_init(db_error_cb);