[systemd-commits] src/libsystemd-network
Tom Gundersen
tomegun at kemper.freedesktop.org
Sat Mar 22 02:54:14 PDT 2014
src/libsystemd-network/test-dhcp-client.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
New commits:
commit 2afa65c3122542b21d1881fada917c89b8913bd4
Author: Tom Gundersen <teg at jklm.no>
Date: Sat Mar 22 10:52:49 2014 +0100
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.
diff --git a/src/libsystemd-network/test-dhcp-client.c b/src/libsystemd-network/test-dhcp-client.c
index ca44cfb..0f7adac 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;
More information about the systemd-commits
mailing list