- May 10, 2019
-
-
Simon McVittie authored
Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
Simon McVittie authored
This matches what Autotools would do, and what our header is expecting. It silences -Wundef. Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
- May 02, 2019
-
-
This only uses Meson because it's not straightforward to do a standalone build with the Autotools goop.
-
Simon McVittie authored
The temporary directory will be deleted on success, but will remain intact on failure. Signed-off-by:
Simon McVittie <smcv@collabora.com>
-
-
- Mar 28, 2019
-
-
Will Thompson authored
-
- Dec 07, 2018
-
-
Colin Walters authored
shutil: Prefix error with path in rm_rf() See merge request GNOME/libglnx!4
-
Colin Walters authored
First, let's ensure the filename is prefixed consistently. Second, add the entrypoint as a prefix when recursing. This is best practice to help debugging. Motivated by https://discussion.fedoraproject.org/t/boot-partition-of-silverblue-is-without-space/771/9
-
- Nov 30, 2018
-
-
Colin Walters authored
-
Colin Walters authored
Fix docs for glnx_file_replace_contents() See merge request GNOME/libglnx!3
-
Owen W. Taylor authored
The docs for `glnx_file_replace_contents[_with_perms]` say that the default mode is 0666 - umask, but it's actually 0644. Because there's no thread-safe way of finding out the current umask without grubbing around in /proc/self/status, simply make the docs reflect reality.
-
- Jul 13, 2018
-
-
Colin Walters authored
libglnx.m4: Include stdio.h for renameat2 See merge request GNOME/libglnx!2
-
- Jul 11, 2018
-
-
Colin Walters authored
glibc added it upstream: https://sourceware.org/git/?p=glibc.git;a=commit;h=d6da5cb6a8e0e8a9ce92b7d951a254cf325248d7 But we need the right header. Ref: https://github.com/flatpak/flatpak/issues/1890
-
- May 29, 2018
-
-
Philip Withnall authored
Add g_autoptr support for GAsyncResult,GMount,GVolumeMonitor See merge request GNOME/libglnx!1
-
Matthew Leeds authored
-
- May 08, 2018
-
-
Colin Walters authored
This was inherited from some other code; perhaps the idea was to ensure the console is in a consistent state before starting a progress bar, but it causes extra newlines which is distracting.
-
- May 04, 2018
-
-
Jonathan Lebon authored
In glibc 2.27, a wrapper for `copy_file_range` was added[1]. The function is now always defined, either using a userspace fallback or just returning `ENOSYS` if the kernel doesn't support it. This throws off our preprocessor conditionals. Work around this by just renaming our implementation differently. This is similar to what systemd did[2]. Hit this when trying to build on F28, which rebased to glibc 2.27. [1] https://sourceware.org/git/?p=glibc.git;a=commit;h=bad7a0c81f501fbbcc79af9eaa4b8254441c4a1f [2] https://github.com/systemd/systemd/commit/5187dd2c403caf92d09f3491e41f1ceb3f10491f
-
- Feb 19, 2018
-
-
Aurelien Jarno authored
glibc 2.27 added support for memfd_create. Unfortunately flatpak-builder, or rather the included libglnx library, also has such a function to wrap the corresponding syscall. It correctly tries to detect it in the configure script to disabled the wrapper in case glibc provides it. However it doesn't work due to a missing include. Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=890722
-
- Jan 10, 2018
-
-
Jonathan Lebon authored
Share its static var goodness with clients. This will be used in rpm-ostree from various places which sometimes do use a `GLnxConsole` and sometimes don't, so it's more convenient to make it its own function.
-
- Dec 12, 2017
-
-
Colin Walters authored
For TTYs, it slows things down pointlessly. For non-TTYs like Jenkins jobs, it creates a ton of output that obscures useful information.
-
Colin Walters authored
The idea was clearly to avoid useless updates, but we never actually *set* these values. Drop the code for now to avoid confusion, I'll reimplement this in a better way.
-
Colin Walters authored
IMO, it looks bad to have a really big progress bar. I personally usually work on a 27" monitor with maximized terminals.
-
Colin Walters authored
It's often really useful to see the counts, not just the percentage.
-
Colin Walters authored
rpm-ostree at least uses `dirname()` and relied on the `#include <libgen.h>` that we had previously.
-
- Nov 14, 2017
-
-
Ray Strode authored
At the top of glnx-fdio.h there's this comment: /* When we include libgen.h because we need * dirname() we immediately undefine * basename() since libgen.h defines it as * a macro to the XDG version which is really * broken. */ and then it does #undef basename to try to gain access to non-default basename implementation. The problem is that this trick doesn't work on some systems: ./libglnx/glnx-fdio.h: In function 'glnx_basename': ./libglnx/glnx-fdio.h:46:11: error: 'basename' undeclared (first use in this function) return (basename) (path); Anyway, basename() is like 3 lines of code to implement, so this commit just does that instead of relying on glibc for it.
-
- Nov 02, 2017
-
-
Will Thompson authored
This caused GCC 6.3.0 -Winline to complain: ../../../ext/libglnx/glnx-errors.h:169:1: warning: function ‘glnx_throw_errno_prefix’ can never be inlined because it uses variable argument lists [-Winline] glnx_throw_errno_prefix (GError **error, const char *fmt, ...) ^~~~~~~~~~~~~~~~~~~~~~~ ../../../ext/libglnx/glnx-errors.h:169:1: warning: inlining failed in call to ‘glnx_throw_errno_prefix’: function not inlinable [-Winline]
-
Colin Walters authored
Followup to previous commit; this helps me build libostree with `-Werror=undef`.
-
Will Thompson authored
Without this, including glnx-missing-syscall.h raises this warning: ../ext/libglnx/glnx-missing-syscall.h:121:6: warning: "HAVE_DECL_COPY_FILE_RANGE" is not defined [-Wundef] #if !HAVE_DECL_COPY_FILE_RANGE ^~~~~~~~~~~~~~~~~~~~~~~~~
-
- Oct 24, 2017
-
-
Colin Walters authored
Use decl-after-stmt where applicable.
-
- Oct 16, 2017
-
-
Colin Walters authored
Port to `glnx_autofd` tree wide, and add one missed `glnx_close_fd()` use in the tmpfile code.
-
- Oct 11, 2017
-
-
Colin Walters authored
`g-ir-scanner` is unaware of this GNUC extension and complains. Saw that while building ostree. While we're here, fix up a few other things: - Tell the compiler the stat buffer is unused (I didn't see a warning, just doing this on general principle) - Return from `glnx_throw_errno_prefix()` directly; we do preserve errno there, let's feel free to rely on it.
-
Jonathan Lebon authored
-
- Oct 06, 2017
-
-
Jonathan Lebon authored
Often, the caller doesn't actually care about the details of the stat struct itself, but just whether the entry exists or not. It does work to just pass `NULL` directly to glibc in a quick test, but given that the argument is tagged as `__nonnull` and that the documentation does not explicitly specify this is supported, let's do this safely.
-
Colin Walters authored
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.
-
- Oct 05, 2017
-
-
Colin Walters authored
Oops.
-
- Oct 02, 2017
-
-
Colin Walters authored
I was using this in rpm-ostree and glanced at the code. This was clearly the intent, but isn't a full fix. See code comments for more details.
-
- Oct 01, 2017
-
-
Colin Walters authored
Planning to use memfd_create() in flatpak and rpm-ostree, which both use bubblewrap, and want to pass read-only data via file descriptor to the container. Passing via `O_TMPFILE` requires `O_RDWR` (read and write), and passing via a pipe would require buffering. The systemd `missing.h` has grown enormously; I only cherry-picked the bits for memfd.
-
- Sep 26, 2017
-
-
Philip Withnall authored
If the directory for @dfd is deleted after being opened, glnx_shutil_mkdir_p_at() would fail with an assertion failure. Fix that, and make it return an ENOENT error instead. Add a unit test. Signed-off-by:
Philip Withnall <withnall@endlessm.com> Reviewed-by:
Colin Walters <walters@verbum.org> Reviewed-by:
Jonathan Lebon <jlebon@redhat.com> https://github.com/ostreedev/ostree/issues/1215
-
- Sep 25, 2017
-
-
Colin Walters authored
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.
-
Jonathan Lebon authored
This was in my workspace for a while. `strlen` returns a `size_t` and `alloca` expects a `size_t`.
-