projects
/
rrdd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
src/rrdd.c: Ignore SIGPIPE.
[rrdd.git]
/
src
/
rrdd.c
diff --git
a/src/rrdd.c
b/src/rrdd.c
index
71674bc
..
14543ce
100644
(file)
--- a/
src/rrdd.c
+++ b/
src/rrdd.c
@@
-122,6
+122,7
@@
static void *queue_thread_main (void *args) /* {{{ */
char *file;
char **values;
int values_num;
char *file;
char **values;
int values_num;
+ int status;
int i;
if (cache_queue_head == NULL)
int i;
if (cache_queue_head == NULL)
@@
-159,6
+160,14
@@
static void *queue_thread_main (void *args) /* {{{ */
RRDD_LOG (LOG_DEBUG, "queue_thread_main: rrd_update (%s, %i, %p)",
file, values_num, (void *) values);
RRDD_LOG (LOG_DEBUG, "queue_thread_main: rrd_update (%s, %i, %p)",
file, values_num, (void *) values);
+ status = rrd_update_r (file, NULL, values_num, values);
+ if (status != 0)
+ {
+ RRDD_LOG (LOG_ERR, "queue_thread_main: "
+ "rrd_update_r failed with status %i.",
+ status);
+ }
+
free (file);
for (i = 0; i < values_num; i++)
free (values[i]);
free (file);
for (i = 0; i < values_num; i++)
free (values[i]);
@@
-623,6
+632,10
@@
static int daemonize (void) /* {{{ */
memset (&sa, 0, sizeof (sa));
sa.sa_handler = sig_term_handler;
sigaction (SIGINT, &sa, NULL);
memset (&sa, 0, sizeof (sa));
sa.sa_handler = sig_term_handler;
sigaction (SIGINT, &sa, NULL);
+
+ memset (&sa, 0, sizeof (sa));
+ sa.sa_handler = SIG_IGN;
+ sigaction (SIGPIPE, &sa, NULL);
}
openlog ("rrdd", LOG_PID, LOG_DAEMON);
}
openlog ("rrdd", LOG_PID, LOG_DAEMON);
@@
-652,7
+665,10
@@
static int cleanup (void) /* {{{ */
do_shutdown++;
do_shutdown++;
+ RRDD_LOG (LOG_DEBUG, "cleanup: Joining queue_thread..");
+ pthread_cond_signal (&cache_cond);
pthread_join (queue_thread, /* return = */ NULL);
pthread_join (queue_thread, /* return = */ NULL);
+ RRDD_LOG (LOG_DEBUG, "cleanup: done");
closelog ();
closelog ();