| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
| |
I'd like to have the checks for `EBADF` as well as the
"assign to -1" in more places. The cleanup function we
had for `glnx_fd_close` is actually what we want.
Let's rename the cleanup macro to `glnx_autofd` to better match
other autocleanups like `g_autofree`.
Then we can use `glnx_fd_close()` as a replacement for plain Unix `close()`. I
left the `glnx_close_fd` macro, but it's obviously confusing now with the
former. We'll eventually remove it.
|
|
|
|
|
|
|
|
|
|
| |
We should be able to rely upstream on everything *except* `glnx_unref_object`
which requires the library itself to depend on a newer glib, which isn't true
for e.g. RHEL7 libsoup.
libostree was almost ready for this; just a few patches to push
it to completion in
https://github.com/ostreedev/ostree/pull/1042
|
|
|
|
|
|
| |
systemd does this by default. I think we should treat this as a fatal error
since it can cause really painful-to-debug problems if we don't just get
EBADF but actually close something else's fd due to a race.
|
|
|
|
|
|
|
|
| |
In general, all FDs < 0 are invalid (and should not have close() called
on them), so check that. This could have caused problems if a function
returned an error value < -1.
Signed-off-by: Philip Withnall <withnall@endlessm.com>
|
|
|
|
|
|
| |
We're ignoring the result from the close, but it can still affect
errno, which is bad if you use this in functions that sets
errno, because errno can unexpectedly change after you've set it.
|
|
|
|
|
|
| |
This is very useful in combination with glnx_close_fd
https://bugzilla.gnome.org/show_bug.cgi?id=757611
|
|
This module is a new successor to libgsystem. It currently contains a
backport of the GLib cleanup macros, but soon more Linux-specific code
will be added.
|