Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/bsd/blacklist/bin restore rules after the database ...



details:   https://anonhg.NetBSD.org/src/rev/fcbb9f919752
branches:  trunk
changeset: 347960:fcbb9f919752
user:      christos <christos%NetBSD.org@localhost>
date:      Mon Sep 26 19:43:43 2016 +0000

description:
restore rules after the database is open, add error message to prevent
silent failure in the future. (Kurt Lidl)

diffstat:

 external/bsd/blacklist/bin/blacklistd.c |  10 +++++-----
 external/bsd/blacklist/bin/state.c      |   8 +++++---
 2 files changed, 10 insertions(+), 8 deletions(-)

diffs (68 lines):

diff -r b3b8e7d98f69 -r fcbb9f919752 external/bsd/blacklist/bin/blacklistd.c
--- a/external/bsd/blacklist/bin/blacklistd.c   Mon Sep 26 14:50:54 2016 +0000
+++ b/external/bsd/blacklist/bin/blacklistd.c   Mon Sep 26 19:43:43 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: blacklistd.c,v 1.34 2016/04/04 15:52:56 christos Exp $ */
+/*     $NetBSD: blacklistd.c,v 1.35 2016/09/26 19:43:43 christos Exp $ */
 
 /*-
  * Copyright (c) 2015 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 #include "config.h"
 #endif
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: blacklistd.c,v 1.34 2016/04/04 15:52:56 christos Exp $");
+__RCSID("$NetBSD: blacklistd.c,v 1.35 2016/09/26 19:43:43 christos Exp $");
 
 #include <sys/types.h>
 #include <sys/socket.h>
@@ -473,9 +473,6 @@
                flags |= O_TRUNC;
        }
 
-       if (restore)
-               rules_restore();
-
        struct pollfd *pfd = NULL;
        bl_t *bl = NULL;
        size_t nfd = 0;
@@ -500,6 +497,9 @@
        if (state == NULL)
                return EXIT_FAILURE;
 
+       if (restore)
+               rules_restore();
+
        if (!debug) {
                if (daemon(0, 0) == -1)
                        err(EXIT_FAILURE, "daemon failed");
diff -r b3b8e7d98f69 -r fcbb9f919752 external/bsd/blacklist/bin/state.c
--- a/external/bsd/blacklist/bin/state.c        Mon Sep 26 14:50:54 2016 +0000
+++ b/external/bsd/blacklist/bin/state.c        Mon Sep 26 19:43:43 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: state.c,v 1.18 2016/04/04 15:52:56 christos Exp $      */
+/*     $NetBSD: state.c,v 1.19 2016/09/26 19:43:43 christos Exp $      */
 
 /*-
  * Copyright (c) 2015 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
 #endif
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: state.c,v 1.18 2016/04/04 15:52:56 christos Exp $");
+__RCSID("$NetBSD: state.c,v 1.19 2016/09/26 19:43:43 christos Exp $");
 
 #include <sys/types.h>
 #include <sys/socket.h>
@@ -200,8 +200,10 @@
        int rv;
        DBT k, v;
 
-       if (db == NULL)
+       if (db == NULL) {
+               (*lfun)(LOG_ERR, "%s: called with no database file", __func__);
                return -1;
+       }
 
        first = first ? R_FIRST : R_NEXT;
 



Home | Main Index | Thread Index | Old Index