1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-06 16:59:03 +03:00
systemd/src/libsystemd/sd-resolve
Lennart Poettering 03e334a1c7 util: replace close_nointr_nofail() by a more useful safe_close()
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.
2014-03-18 19:31:34 +01:00
..
Makefile
resolve-util.h resolve: update sd-resolve to match the other APIs in style and functionality 2014-01-27 20:12:59 +01:00
sd-resolve.c util: replace close_nointr_nofail() by a more useful safe_close() 2014-03-18 19:31:34 +01:00
test-resolve.c api: in constructor function calls, always put the returned object pointer first (or second) 2014-02-20 00:03:10 +01:00