summaryrefslogtreecommitdiff
path: root/src/libsystemd-network/test-dhcp-client.c
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2014-03-22 10:52:49 +0100
committerTom Gundersen <teg@jklm.no>2014-03-22 10:52:49 +0100
commit2afa65c3122542b21d1881fada917c89b8913bd4 (patch)
tree0501209cdb27d3e07e542eeaa85076791f1a3d58 /src/libsystemd-network/test-dhcp-client.c
parentc6f7c917a1b494d4455800823472227463f87438 (diff)
sd-dhcp-client: test - don't close socket twice
One end of the socketpair is closed by the library, so only close our end. Also switch to the safe_close() so we get notified about problems with closing.
Diffstat (limited to 'src/libsystemd-network/test-dhcp-client.c')
-rw-r--r--src/libsystemd-network/test-dhcp-client.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/libsystemd-network/test-dhcp-client.c b/src/libsystemd-network/test-dhcp-client.c
index ca44cfbdc5..0f7adac562 100644
--- a/src/libsystemd-network/test-dhcp-client.c
+++ b/src/libsystemd-network/test-dhcp-client.c
@@ -253,8 +253,7 @@ static void test_discover_message(sd_event *e)
sd_dhcp_client_stop(client);
sd_dhcp_client_free(client);
- close(test_fd[0]);
- close(test_fd[1]);
+ test_fd[1] = safe_close(test_fd[1]);
callback_recv = NULL;
}
@@ -482,8 +481,7 @@ static void test_addr_acq(sd_event *e)
sd_dhcp_client_stop(client);
sd_dhcp_client_free(client);
- close(test_fd[0]);
- close(test_fd[1]);
+ test_fd[1] = safe_close(test_fd[1]);
callback_recv = NULL;
xid = 0;