aboutsummaryrefslogtreecommitdiffstats
path: root/meta-networking/recipes-daemons/ippool/ippool/0001-usl_timer-Check-for-return-value-of-write-API.patch
blob: 6fb7cc5c461ea85e46a9977b58a99984ff07f1e7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
From 5d7f20c045b3c74dad2c53d65e30bd4840250082 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Tue, 27 Jun 2017 15:17:19 -0700
Subject: [PATCH] usl_timer: Check for return value of write() API

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 usl/usl_timer.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/usl/usl_timer.c b/usl/usl_timer.c
index fda752b..d8414a6 100644
--- a/usl/usl_timer.c
+++ b/usl/usl_timer.c
@@ -94,7 +94,9 @@ void usl_timer_tick(void)
 
 	if (!usl_tick_pending) {
 		usl_tick_pending = 1;
-		write(usl_tick_pipe[1], &msg, sizeof(msg));
+		if (write(usl_tick_pipe[1], &msg, sizeof(msg)) != sizeof(msg)) {
+			fprintf(stderr, "write to fd %i failed: %s\n", usl_tick_pipe[1], strerror(errno));
+		}
 	}
 }
 
-- 
2.13.2