| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
Port to `glnx_autofd` tree wide, and add one missed `glnx_close_fd()` use in the
tmpfile code.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
| |
This makes us more friendly to being embedded in a GObject or
the like that's fully zero-initialized, rather than relying on the special
`-1` value for the fd.
Calls to `glnx_release_lock_file()` become idempotent, so it's easy to call it
unconditionally in an object finalizer.
|
|
|
|
| |
Followup to similar commits in the ostree stack recently.
|
|
|
|
| |
There's a lot more fdio code, starting with some of the easier ones.
|
|
|
|
|
| |
This happens a lot if you use autocleanup for lock files, and the
function returns early without the lock being taken.
|
|
Will be used by OSTree to lock the sysroot against concurrent
manipulation. Taken from current systemd git master, tweaked to
GLibify.
|