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
..
2014-03-18 19:31:34 +01:00
2014-03-18 19:31:34 +01:00
2013-12-22 21:12:25 +01:00
2014-03-17 01:55:47 -04:00
2014-03-18 19:31:34 +01:00
2014-01-31 11:55:01 +01:00
2014-03-18 19:31:34 +01:00
2014-03-18 19:31:34 +01:00
2014-01-11 16:54:59 -05:00
2014-03-17 01:55:48 -04:00
2013-12-11 23:10:36 +01:00
2014-03-18 00:02:09 -04:00
2014-03-17 01:55:48 -04:00
2014-03-17 01:55:48 -04:00
2014-03-17 01:55:48 -04:00
2014-03-17 21:50:49 +01:00
2014-03-18 19:31:34 +01:00
2014-02-23 17:05:37 +01:00
2014-01-11 16:54:59 -05:00
2014-03-18 19:31:34 +01:00
2014-03-18 19:31:34 +01:00
2014-03-18 19:31:34 +01:00
2014-03-14 22:05:25 +01:00
2014-03-18 19:31:34 +01:00
2013-12-11 20:55:09 +01:00
2014-03-17 01:55:47 -04:00
2014-03-17 01:55:47 -04:00
2013-12-22 21:12:25 +01:00
2014-03-18 19:31:34 +01:00
2014-03-14 22:05:25 +01:00
2014-03-18 19:31:34 +01:00
2013-12-11 20:55:09 +01:00
2014-03-16 09:52:56 -04:00
2013-12-10 20:38:33 -05:00
2014-03-14 22:05:25 +01:00
2014-03-14 22:05:25 +01:00
2014-03-17 01:55:47 -04:00
2014-03-14 22:05:25 +01:00
2014-03-18 00:03:14 -04:00
2014-03-17 01:55:48 -04:00
2014-01-11 10:07:22 -05:00
2014-01-11 10:07:22 -05:00
2014-03-18 19:31:34 +01:00
2014-01-28 13:47:35 +01:00
2013-11-27 01:01:53 +01:00
2013-08-02 11:25:45 -04:00
2014-01-11 16:54:59 -05:00
2013-08-22 00:52:14 -04:00
2013-12-15 02:31:01 +01:00
2014-03-18 19:31:34 +01:00
2014-01-11 16:54:59 -05:00
2014-03-18 19:31:34 +01:00