- Oct 25, 2016
-
-
Colin Walters authored
I wanted to add a new one, and realized it was wrong. Luckily, I think we were safe until now, since the set of bits for `(0, 1, 2)` is actually distinct. Although, hm, callers specifying `GLNX_FILE_COPY_OVERWRITE` may have not actually been getting that.
-
- Jul 01, 2016
-
-
Colin Walters authored
We had a bug previously where we failed to clean up a temporary file in an error path. This is a classic case where the new `O_TMPFILE` API in Linux is nicer. To implement this, as usual we start with some original bits from systemd. But in this case I ended up having to heavily modify it because systemd doesn't support "link into place and overwrite". They don't actually use their tempfile code much at all in fact - as far as I can tell, just in the coredump code. Whereas in many apps, ostree included, a very common use case is atomically updating an existing file, which is `glnx_file_replace_contents_at()`, including subtleties like doing an `fdatasync()` if the file already existed. Implementing this then is slightly weird since we need to link() the file into place, then rename() after. It's still better though because if we e.g. hit `ENOSPC` halfway through, we'll clean up the file automatically. We still do keep the mode where we error out if the file exists. Finally, the ostree core though does have a more unusual case where we want to ignore EEXIST (allow concurrent object writers), so add support for that now. Note: One really confusing bug I had here was that `O_TMPFILE` ignores the provided mode, and this caused ostree to write refs that weren't world readable. Rework things so we always call `fchmod()`, but as a consequence we're no longer honoring umask in the default case. I doubt anyone will care, and if they do we should probably fix ostree to consistently use a mode inherited from the repo or something.
-
- May 03, 2016
-
-
Colin Walters authored
Migrated from libgsystem's `gs_stream_fstat()`. It's a small function but I end up using it in OSTree a fair bit.
-
- Jan 11, 2016
-
-
Colin Walters authored
I plan to use this in rpm-ostree. Sad how many times this gets reinvented. Should probably stick a copy in `glib-unix.h` or so.
-
- Apr 09, 2015
-
-
Colin Walters authored
This will be used for OSTree too.
-
Colin Walters authored
Sort of similar to `g_file_replace_contents()` but `*at()`. Will be used for further conversion of OSTree to `*at()`.
-
- Apr 07, 2015
-
-
Colin Walters authored
Most callers already included `string.h` which is why I didn't see this earlier.
-
- Apr 01, 2015
-
-
Colin Walters authored
See https://github.com/GNOME/ostree/pull/78
-
- Mar 05, 2015
-
-
Colin Walters authored
We have to wrap the glibc version to ensure we get the right version, otherwise depending on the variance of includes we may end up crashing if we get the POSIX version.
-
- Mar 03, 2015
-
-
Colin Walters authored
This will allow deleting some code from OSTree for the config file merging. We're reusing some code from systemd, which a nice modern clean codebase, and among other things this gets us BTRFS reflinking (if available) again.
-
- Feb 20, 2015
-
-
Colin Walters authored
We don't have this really in GLib, unfortunately. We do want GCancellable, but we also want to operate on raw fds where possible. The "read a file and validate as UTF-8" is a common use case of mine, and this combines that with openat().
-
- Feb 15, 2015
-
-
Colin Walters authored
-
- Feb 14, 2015
-
-
Colin Walters authored
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.
-