03e334a1c7
safe_close() automatically becomes a NOP when a negative fd is passed, and returns -1 unconditionally. This makes it easy to write lines like this: fd = safe_close(fd); Which will close an fd if it is open, and reset the fd variable correctly. By making use of this new scheme we can drop a > 200 lines of code that was required to test for non-negative fds or to reset the closed fd variable afterwards. |
||
---|---|---|
.. | ||
dhcp-internal.h | ||
dhcp-lease-internal.h | ||
dhcp-network.c | ||
dhcp-option.c | ||
dhcp-packet.c | ||
dhcp-protocol.h | ||
ipv4ll-internal.h | ||
ipv4ll-network.c | ||
ipv4ll-packet.c | ||
Makefile | ||
sd-dhcp-client.c | ||
sd-dhcp-lease.c | ||
sd-ipv4ll.c | ||
test-dhcp-client.c | ||
test-dhcp-option.c |