summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* README: update link to libgsystemreadme-libgsystemWill Thompson2019-12-021-1/+1
| | | | I was curious.
* Merge branch 'older-glibs' into 'master'Simon McVittie2019-11-114-0/+45
|\ | | | | | | | | Build successfully on GLib 2.32 See merge request GNOME/libglnx!7
| * Make tests cope with older GLibSimon McVittie2019-11-112-0/+16
| | | | | | | | Signed-off-by: Simon McVittie <smcv@collabora.com>
| * backport-autocleanups: Hide autocleanups for types we don't haveSimon McVittie2019-11-111-0/+8
| | | | | | | | | | | | | | | | | | If you're building on a really old GLib, you might not have GTask, GSubprocess or g_markup_parse_context_unref(), among others. This gets libglnx compiling (and apparently working) on GLib versions as old as 2.32. Signed-off-by: Simon McVittie <smcv@collabora.com>
| * backports: Add a backport of g_clear_pointer()Simon McVittie2019-11-112-0/+21
|/ | | | | | | This will be necessary if targeting GLib versions older than 2.34, such as GLib 2.32 in Ubuntu 12.04 and the Steam Runtime. Signed-off-by: Simon McVittie <smcv@collabora.com>
* Merge branch 'testlib-automake' into 'master'Colin Walters2019-11-041-5/+7
|\ | | | | | | | | build-sys: Add libglnx-testlib.c to Automake See merge request GNOME/libglnx!12
| * build-sys: Add libglnx-testlib.c to AutomakeColin Walters2019-11-041-5/+7
|/ | | | It was introduced in a previous commit but only added to `meson.build`.
* Merge branch 'reopen-rdonly' into 'master'Colin Walters2019-11-042-2/+44
|\ | | | | | | | | fdio: Add glnx_tmpfile_reopen_rdonly() See merge request GNOME/libglnx!11
| * fdio: Add glnx_tmpfile_reopen_rdonly()Colin Walters2019-11-042-2/+44
|/ | | | For fs-verity.
* Merge branch 'meson-older-compilers' into 'master'Colin Walters2019-10-117-0/+236
|\ | | | | | | | | Add Meson build system and Gitlab-CI See merge request GNOME/libglnx!8
| * CI: Target a Fedora stable releaseSimon McVittie2019-05-131-1/+1
| | | | | | | | | | | | As suggested by @jlebon on libglnx!8. Signed-off-by: Simon McVittie <smcv@collabora.com>
| * Make the Meson build work on older compilersSimon McVittie2019-05-101-0/+2
| | | | | | | | Signed-off-by: Simon McVittie <smcv@collabora.com>
| * meson: Define HAVE_DECL_FOO to 0 if foo isn't declaredSimon McVittie2019-05-101-3/+2
| | | | | | | | | | | | | | This matches what Autotools would do, and what our header is expecting. It silences -Wundef. Signed-off-by: Simon McVittie <smcv@collabora.com>
| * Add GitLab CIWill Thompson2019-05-021-0/+22
| | | | | | | | | | This only uses Meson because it's not straightforward to do a standalone build with the Autotools goop.
| * Run the fdio test in its own temporary directorySimon McVittie2019-05-024-1/+86
| | | | | | | | | | | | | | The temporary directory will be deleted on success, but will remain intact on failure. Signed-off-by: Simon McVittie <smcv@collabora.com>
| * Document using this as a Meson subprojectWill Thompson2019-05-021-0/+26
| |
| * Add meson.build filesWill Thompson2019-03-282-0/+102
| |
* | Merge branch 'anonymous-tmpfile-dir' into 'master'Colin Walters2019-10-112-6/+30
|\ \ | | | | | | | | | | | | Add glnx_open_anonymous_tmpfile_full() allowing you to specify the directory See merge request GNOME/libglnx!10
| * | Add glnx_open_anonymous_tmpfile_full() allowing you to specify the directoryAlexander Larsson2019-10-092-6/+30
|/ / | | | | | | | | | | | | | | | | This is useful if you need the file to be on a particular filesystem. In particular, flatpak wants this to make tempfiles on /tmp for things we need to write during flatpak run, such as the libseccomp output fd. We've had "flatpak run" stop working in low disk situations without this, so its nice to be able to fix it.
* | Merge branch 'us-temp-failure-retry' into 'master'Colin Walters2019-09-171-0/+10
|\ \ | | | | | | | | | | | | macros: Add TEMP_FAILURE_RETRY for musl See merge request GNOME/libglnx!9
| * | macros: Add TEMP_FAILURE_RETRY for muslAlex Kiernan2019-09-091-0/+10
|/ / | | | | | | | | | | | | | | TEMP_FAILURE_RETRY is glibc specific, add a definition for musl. See https://github.com/ostreedev/ostree/issues/731 Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
* | Merge branch 'uchar' into 'master'Jonathan Lebon2019-05-131-1/+0
|\ \ | |/ |/| | | | | missing: Remove unused <uchar.h> See merge request GNOME/libglnx!6
| * missing: Remove unused <uchar.h>Simon McVittie2019-05-021-1/+0
|/ | | | | | | This doesn't exist on some very old platforms. In the original file in systemd, it was here for char32_t and char16_t, which we don't use. Signed-off-by: Simon McVittie <smcv@collabora.com>
* Merge branch 'shutil-rm-rf-errprefix' into 'master'Colin Walters2018-12-071-16/+24
|\ | | | | | | | | shutil: Prefix error with path in rm_rf() See merge request GNOME/libglnx!4
| * shutil: Prefix error with path in rm_rf()Colin Walters2018-12-071-16/+24
|/ | | | | | | | 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
* README: Update ContributingColin Walters2018-11-301-5/+3
|
* Merge branch 'replace-contents-umask' into 'master'Colin Walters2018-11-301-3/+2
|\ | | | | | | | | Fix docs for glnx_file_replace_contents() See merge request GNOME/libglnx!3
| * Fix docs for glnx_file_replace_contents()Owen W. Taylor2018-11-301-3/+2
|/ | | | | | | 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.
* Merge branch 'renameat2-stdio' into 'master'Colin Walters2018-07-131-0/+1
|\ | | | | | | | | libglnx.m4: Include stdio.h for renameat2 See merge request GNOME/libglnx!2
| * libglnx.m4: Include stdio.h for renameat2Colin Walters2018-07-111-0/+1
|/ | | | | | | | 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
* Merge branch 'backport-autoptr-support' into 'master'Philip Withnall2018-05-291-0/+3
|\ | | | | | | | | Add g_autoptr support for GAsyncResult,GMount,GVolumeMonitor See merge request GNOME/libglnx!1
| * Add g_autoptr support for GAsyncResult,GMount,GVolumeMonitorMatthew Leeds2018-05-281-0/+3
|/
* console: Drop newline on glnx_console_lockColin Walters2018-05-081-1/+1
| | | | | | 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.
* missing-syscalls: Use different name for copy_file_rangeJonathan Lebon2018-05-041-4/+6
| | | | | | | | | | | | | 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
* Include sys/mman.h when checking for memfd_createAurelien Jarno2018-02-191-0/+1
| | | | | | | | | | 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
* console: make stdout_is_tty() publicJonathan Lebon2018-01-102-5/+7
| | | | | | | 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.
* console: Avoid rendering too quicklyColin Walters2017-12-121-0/+28
| | | | | For TTYs, it slows things down pointlessly. For non-TTYs like Jenkins jobs, it creates a ton of output that obscures useful information.
* console: Drop unused current_text/current_percentColin Walters2017-12-121-11/+0
| | | | | | 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.
* console: Limit progress bar to 20 columns maxColin Walters2017-12-121-2/+9
| | | | | IMO, it looks bad to have a really big progress bar. I personally usually work on a 27" monitor with maximized terminals.
* console: Add an "n items" APIColin Walters2017-12-122-1/+31
| | | | It's often really useful to see the counts, not just the percentage.
* fdio: Include libgen.h again for dirname()Colin Walters2017-12-121-3/+3
| | | | | rpm-ostree at least uses `dirname()` and relied on the `#include <libgen.h>` that we had previously.
* fdio: implement glnx_basename from scratchRay Strode2017-11-141-7/+8
| | | | | | | | | | | | | | | | | | | | | | | | | 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.
* errors: don't use 'static inline' on varargs functionsWill Thompson2017-11-022-66/+78
| | | | | | | | | | | | | 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]
* missing-syscall: #include config.hColin Walters2017-11-021-0/+1
| | | | | Followup to previous commit; this helps me build libostree with `-Werror=undef`.
* Add missing configure check for copy_file_rangeWill Thompson2017-11-021-1/+4
| | | | | | | | 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 ^~~~~~~~~~~~~~~~~~~~~~~~~
* tree-wide: Some new style portingColin Walters2017-10-243-57/+43
| | | | Use decl-after-stmt where applicable.
* tree-wide: Use glnx_autofd and glnx_close_fd()Colin Walters2017-10-168-23/+19
| | | | | Port to `glnx_autofd` tree wide, and add one missed `glnx_close_fd()` use in the tmpfile code.
* fdio: Avoid ?: syntax for fstatat_allow_noent()Colin Walters2017-10-111-8/+4
| | | | | | | | | | | | `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.
* tests: drop unused variableJonathan Lebon2017-10-111-1/+0
|
* fdio: allow NULL for fstatat_allow_noent stbufJonathan Lebon2017-10-062-2/+13
| | | | | | | | 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.