Modified: trunk/OpenDNSSEC/signer/src/signer/namedb.c
===================================================================
- --- trunk/OpenDNSSEC/signer/src/signer/namedb.c 2012-08-09 09:36:35
UTC (rev 6514)
+++ trunk/OpenDNSSEC/signer/src/signer/namedb.c 2012-08-09 14:19:56
UTC (rev 6515)
@@ -215,9 +215,11 @@
} else if (ods_strcmp(format, "datecounter") == 0) {
soa = (uint32_t) time_datestamp(0, "%Y%m%d", NULL) * 100;
if (!util_serial_gt(soa, prev)) {
- - ods_log_warning("[%s] unable to use datecounter as serial: %u "
- - "does not increase %u. Serial set to %u", db_str, soa, prev,
- - (prev+1));
+ if (!db->is_initialized) {
+ ods_log_warning("[%s] unable to use datecounter as serial: %u "
+ "does not increase %u. Serial set to %u", db_str, soa, prev,
+ (prev+1));
+ }
soa = prev + 1;
}
} else if (ods_strcmp(format, "counter") == 0) {
Modified: trunk/OpenDNSSEC/signer/src/signer/tools.c
===================================================================
- --- trunk/OpenDNSSEC/signer/src/signer/tools.c 2012-08-09 09:36:35 UTC
(rev 6514)
+++ trunk/OpenDNSSEC/signer/src/signer/tools.c 2012-08-09 14:19:56 UTC
(rev 6515)
@@ -39,6 +39,7 @@
#include "signer/tools.h"
#include "signer/zone.h"
+#include <errno.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
@@ -213,7 +214,7 @@
/* kick the nameserver */
if (zone->notify_ns) {
int status;
- - pid_t pid;
+ pid_t pid, wpid;
ods_log_verbose("[%s] notify nameserver: %s", tools_str,
zone->notify_ns);
/** fork */
@@ -236,9 +237,20 @@
ods_log_debug("[%s] notify nameserver process forked",
tools_str);
/** wait for completion */
- - while (wait(&status) != pid) {
- - ;
+ while((wpid = waitpid(pid, &status, 0)) <= 0) {
+ if (errno != EINTR) {
+ break;
+ }
}
+ if (wpid == -1) {
+ ods_log_error("[%s] notify nameserver failed: waitpid() ",
+ "failed (%s)", tools_str, strerror(errno));
+ } else if (!WIFEXITED(status)) {
+ ods_log_error("[%s] notify nameserver failed: notify ",
+ "command did not terminate normally", tools_str);
+ } else {
+ ods_log_verbose("[%s] notify nameserver ok", tools_str);
+ }
break;
}
}