|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
From 2f905e821e0342c36f5a5d3a51d53aabccc800bd Mon Sep 17 00:00:00 2001
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
From: Tom Gundersen <teg@jklm.no>
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
Date: Thu, 18 Sep 2014 23:37:07 +0200
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
Subject: [PATCH] timesyncd: check return of setting IP_TOS
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
Fonud by Coverity. Fixes CID #1237534.
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
---
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
src/timesync/timesyncd-manager.c | 4 +++-
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
1 file changed, 3 insertions(+), 1 deletion(-)
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
diff --git a/src/timesync/timesyncd-manager.c b/src/timesync/timesyncd-manager.c
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
index a5678ccaed..46f8bd6d81 100644
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
--- a/src/timesync/timesyncd-manager.c
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+++ b/src/timesync/timesyncd-manager.c
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
@@ -721,7 +721,9 @@ static int manager_listen_setup(Manager *m) {
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
if (r < 0)
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
return -errno;
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- setsockopt(m->server_socket, IPPROTO_IP, IP_TOS, &tos, sizeof(tos));
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ r = setsockopt(m->server_socket, IPPROTO_IP, IP_TOS, &tos, sizeof(tos));
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ if (r < 0)
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ return -errno;
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
return sd_event_add_io(m->event, &m->event_receive, m->server_socket, EPOLLIN, manager_receive_response, m);
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
}
|