diff options
author | Tom Gundersen <teg@jklm.no> | 2014-09-18 23:37:07 +0200 |
---|---|---|
committer | Tom Gundersen <teg@jklm.no> | 2014-09-18 23:37:07 +0200 |
commit | 2f905e821e0342c36f5a5d3a51d53aabccc800bd (patch) | |
tree | d66d4221d261994453b4b1263ee988a46a1c63b5 /src/timesync | |
parent | 25773e7fc59b4ce53d67da4e18bfe4d13ab0b14b (diff) |
timesyncd: check return of setting IP_TOS
Fonud by Coverity. Fixes CID #1237534.
Diffstat (limited to 'src/timesync')
-rw-r--r-- | src/timesync/timesyncd-manager.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/timesync/timesyncd-manager.c b/src/timesync/timesyncd-manager.c index a5678ccaed..46f8bd6d81 100644 --- a/src/timesync/timesyncd-manager.c +++ b/src/timesync/timesyncd-manager.c @@ -721,7 +721,9 @@ static int manager_listen_setup(Manager *m) { if (r < 0) return -errno; - setsockopt(m->server_socket, IPPROTO_IP, IP_TOS, &tos, sizeof(tos)); + r = setsockopt(m->server_socket, IPPROTO_IP, IP_TOS, &tos, sizeof(tos)); + if (r < 0) + return -errno; return sd_event_add_io(m->event, &m->event_receive, m->server_socket, EPOLLIN, manager_receive_response, m); } |