[lttng-dev] [PATCH lttng-tools 10/13] Missing error handling: consumer_signal_init should return its error status

Mathieu Desnoyers mathieu.desnoyers at efficios.com
Wed Dec 17 20:45:21 EST 2014


Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers at efficios.com>
---
 src/common/consumer-timer.c | 4 +++-
 src/common/consumer-timer.h | 2 +-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/common/consumer-timer.c b/src/common/consumer-timer.c
index e7343af..646d323 100644
--- a/src/common/consumer-timer.c
+++ b/src/common/consumer-timer.c
@@ -460,7 +460,7 @@ void consumer_timer_live_stop(struct lttng_consumer_channel *channel)
  * Block the RT signals for the entire process. It must be called from the
  * consumer main before creating the threads
  */
-void consumer_signal_init(void)
+int consumer_signal_init(void)
 {
 	int ret;
 	sigset_t mask;
@@ -471,7 +471,9 @@ void consumer_signal_init(void)
 	if (ret) {
 		errno = ret;
 		PERROR("pthread_sigmask");
+		return -1;
 	}
+	return 0;
 }
 
 /*
diff --git a/src/common/consumer-timer.h b/src/common/consumer-timer.h
index f3fac5d..baaa82b 100644
--- a/src/common/consumer-timer.h
+++ b/src/common/consumer-timer.h
@@ -50,6 +50,6 @@ void consumer_timer_live_start(struct lttng_consumer_channel *channel,
 		int live_timer_interval);
 void consumer_timer_live_stop(struct lttng_consumer_channel *channel);
 void *consumer_timer_thread(void *data);
-void consumer_signal_init(void);
+int consumer_signal_init(void);
 
 #endif /* CONSUMER_TIMER_H */
-- 
2.1.1




More information about the lttng-dev mailing list