chiark / gitweb /
sd-dhcp-client: use close_nointr_nofail()
authorTom Gundersen <teg@jklm.no>
Tue, 11 Mar 2014 09:57:00 +0000 (10:57 +0100)
committerTom Gundersen <teg@jklm.no>
Tue, 11 Mar 2014 11:03:46 +0000 (12:03 +0100)
We are already assuming the close() will not fail, so make it explicit.

src/libsystemd-network/sd-dhcp-client.c

index e0fce5b..f4a83fb 100644 (file)
@@ -185,7 +185,7 @@ static int client_stop(sd_dhcp_client *client, int error) {
                 sd_event_source_unref(client->receive_message);
 
         if (client->fd >= 0)
-                close(client->fd);
+                close_nointr_nofail(client->fd);
         client->fd = -1;
 
         client->timeout_resend = sd_event_source_unref(client->timeout_resend);
@@ -546,7 +546,7 @@ static int client_timeout_t2(sd_event_source *s, uint64_t usec, void *userdata)
         if (client->fd >= 0) {
                 client->receive_message =
                         sd_event_source_unref(client->receive_message);
-                close(client->fd);
+                close_nointr_nofail(client->fd);
                 client->fd = -1;
         }
 
@@ -848,7 +848,7 @@ static int client_handle_message(sd_dhcp_client *client, DHCPMessage *message,
 
                         client->receive_message =
                                 sd_event_source_unref(client->receive_message);
-                        close(client->fd);
+                        close_nointr_nofail(client->fd);
                         client->fd = -1;
                 }