summaryrefslogtreecommitdiff
path: root/gio
Commit message (Collapse)AuthorAgeFilesLines
...
* | | Merge branch 'update-annotations' into 'main'Philip Withnall2023-04-141-2/+2
|\ \ \ | | | | | | | | | | | | | | | | Explicitly mark size parameter as (in) See merge request GNOME/glib!3371
| * | | Explicitly mark size parameter as (in)badcel2023-04-111-2/+2
| | | | | | | | | | | | | | | | The generated gir file marks the size parameter as "out" by default. This is wrong in the context of a caller allocated buffer with a given size. Explicitly marking the size parameter as (in) fixes the issue.
* | | | Merge branch 'feature/sum_apparent_size_only_for_files_and_symlinks' into 'main'Philip Withnall2023-04-143-82/+43
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Align `G_FILE_MEASURE_APPARENT_SIZE` behaviour with `du` from GNU coreutils 9.2 Closes #2965 See merge request GNOME/glib!3358
| * | | | tests/file: Do not rely on du --bytes behaviourJoan Bruguera2023-04-081-82/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As explained in the previous commit, GNU Coreutils 9.2 changes the behaviour of `du --bytes` to only count regular files and symlinks. The previous commit makes the test pass with GNU Coreutils >=9.2, but the machine running the tests may have an older version, or perhaps even a reimplementation such as uutils. So we can't rely on the size returned by `du` to be the consistent across systems any more. However, the plus side of the new behaviour is that the size reported by `du` / `G_FILE_MEASURE_APPARENT_SIZE` is now well-defined across filesystems (as the sum of the sizes of regular files & symlinks), so we can hardcode it. Fixes: https://gitlab.gnome.org/GNOME/glib/-/issues/2965
| * | | | glocalfile: Sum apparent size only for files and symlinksJoan Bruguera2023-04-082-0/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since GNU Coreutils 9.2 (commit 110bcd28386b1f47a4cd876098acb708fdcbbb25), `du --apparent-size` (including `du --bytes`) no longer counts all kinds of files (directories, FIFOs, etc.), but only those for which `st_size` in `struct stat` is defined by POSIX, namely regular files and symlinks (and also rarely supported memory objects). This aligns the behaviour of GLib's `G_FILE_MEASURE_APPARENT_SIZE` flag with the new GNU Coreutils `du` and correct POSIX use. Note that this may be a breaking change for some uses. Link: https://lists.gnu.org/archive/html/bug-coreutils/2023-03/msg00007.html Fixes: https://gitlab.gnome.org/GNOME/glib/-/issues/2965
* | | | | Merge branch 'wip/jtojnar/wl-are-compiler-flags' into 'main'Philip Withnall2023-04-141-1/+1
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | build/gmodule-2.0.pc: Move compiler flags from Libs to Cflags See merge request GNOME/glib!3356
| * | | | | build/gmodule-2.0.pc: Move compiler flags from Libs to CflagsJan Tojnar2023-03-311-1/+1
| | |_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, `-Wl,--export-dynamic` was in `Libs` key of `gmodule-2.0.pc`, even though `-Wl` is a compiler flag, rather than a linker one. This caused issues with API reference builds in evolution-data-server, which passes the output of `pkg-config --libs` through `--ldflags` argument of `gtkdoc-scan`, which are forwarded unchanged to `ld`: ld: unrecognized option '-Wl,--export-dynamic' Let’s move the flag to `Cflags` so that the compiler can deal with it. https://gitlab.gnome.org/GNOME/evolution-data-server/-/issues/463
* | | | | Merge branch 'socket-nonblock' into 'main'Philip Withnall2023-04-143-43/+63
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | gsocket/inotify/gwakeup: Use SOCK_NONBLOCK and O_NONBLOCK to avoid fcntl() syscalls where possible See merge request GNOME/glib!3347
| * | | | | gsocket: Improve wording in a warning message slightlyPhilip Withnall2023-03-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
| * | | | | glib-unix: Add O_NONBLOCK support to g_unix_open_pipe()Philip Withnall2023-03-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for it, but don’t use it anywhere yet — this is an API addition, but currently doesn’t cause any functional changes. It’ll be used in the next commit. Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
| * | | | | inotify: Use IN_NONBLOCK to avoid a fcntl() syscall where possiblePhilip Withnall2023-03-231-4/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The `inotify_init1()` API has supported this flag for a long time (possibly since it was first introduced, although I haven’t bothered doing the archaeology). This saves a syscall when first connecting to inotify. Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
| * | | | | gsocket: Use SOCK_NONBLOCK to avoid a fcntl() syscall where possiblePhilip Withnall2023-03-231-38/+51
| | |/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the libc and kernel support `SOCK_NONBLOCK`, we can specify that in the `socket()` flags, and avoid a subsequent call to `fcntl()` to set `O_NONBLOCK`. For modern Linux distributions, this will save a syscall when creating a socket. Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
* | | | | Merge branch 'gio-tool-info-strings' into 'main'Philip Withnall2023-04-141-1/+1
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | gio-tool-info: Fix a duplicate attribute name in the UI See merge request GNOME/glib!3337
| * | | | | gio-tool-info: Fix a duplicate attribute name in the UIPhilip Withnall2023-03-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `gio info` currently prints ‘display name:’ twice. One of those should be ‘edit name:’ — this regressed in commit a374b7c806ca99f75439cffd746e7fbef0fa7a9b. Various translations still have the old string, but some unfortunately do not, so this is effectively a new translatable string again. Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
* | | | | | Merge branch 'bsd-libelf-enabled' into 'main'Philip Withnall2023-04-141-1/+1
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | meson: allow -Dlibelf=enabled without pkg-config See merge request GNOME/glib!3335
| * | | | | | meson: allow -Dlibelf=enabled without pkg-configJan Beich2023-03-201-1/+1
| |/ / / / / | | | | | | | | | | | | | | | | | | gio/meson.build:933:0: ERROR: Dependency "libelf" not found, tried pkgconfig
* | | | | | Merge branch '1264-gdbus-double-unref' into 'main'Philip Withnall2023-04-142-56/+72
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | gdbusconnection: Fix double unref on timeout/cancel sending a message Closes #1264 See merge request GNOME/glib!3291
| * | | | | | gdbusconnection: Improve refcount handling of timeout sourcePhilip Withnall2023-04-141-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The ref on the timeout source owned by `SendMessageData` was being dropped just after attaching the source to the main context, leaving it unowned in that struct. That meant the only ref on the source was held by the `GMainContext` it was attached to. This ref was dropped when returning `G_SOURCE_REMOVE` from `send_message_with_reply_timeout_cb()`. Before that happens, `send_message_data_deliver_error()` is called, which normally calls `send_message_with_reply_cleanup()` and destroys the source. However, if `send_message_data_deliver_error()` is called when the message has already been delivered, calling `send_message_with_reply_cleanup()` will be skipped. This leaves the source pointer in `SendMessageData` dangling, which will cause problems when `g_source_destroy()` is subsequently called on it. I’m not sure if it’s possible in practice for this situation to occur, but the code certainly does nothing to prevent it, and it’s easy enough to avoid by keeping a strong ref on the source in `SendMessageData`. Signed-off-by: Philip Withnall <pwithnall@endlessos.org> Helps: #1264
| * | | | | | gdbusconnection: Rearrange refcount handling of map_method_serial_to_taskPhilip Withnall2023-04-141-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It already implicitly held a strong ref on its `GTask` values, but didn’t have a free function set so that they would be automatically unreffed on removal from the map. This meant that the functions handling removals from the map, `on_worker_closed()` (via `cancel_method_on_close()`) and `send_message_with_reply_cleanup()` had to call unref once more than they would otherwise. In `send_message_with_reply_cleanup()`, this behaviour depended on whether it was called with `remove == TRUE`. If not, it was `(transfer none)` not `(transfer full)`. This led to bugs in its callers. For example, this led to a direct leak in `cancel_method_on_close()`, as it needed to remove tasks from `map_method_serial_to_task`, but called `send_message_with_reply_cleanup(remove = FALSE)` and erroneously didn’t call unref an additional time. Try and simplify it all by setting a `GDestroyNotify` on `map_method_serial_to_task`’s values, and making the refcount handling of `send_message_with_reply_cleanup()` not be conditional on its arguments. Signed-off-by: Philip Withnall <pwithnall@endlessos.org> Helps: #1264
| * | | | | | gdbusprivate: Use G_SOURCE_REMOVE in a source callbackPhilip Withnall2023-04-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is equivalent to the current behaviour, but a little clearer in its meaning. Signed-off-by: Philip Withnall <pwithnall@endlessos.org> Helps: #1264
| * | | | | | gdbusprivate: Improve ownership docs for write_message_async()Philip Withnall2023-04-141-9/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The ownership transfers in this code are a bit complex, so adding some extra documentation and `g_steal_pointer()` calls should hopefully help clarify things. This doesn’t introduce any functional changes, just code documentation. Another drive-by improvement in the quest for #1264. Signed-off-by: Philip Withnall <pwithnall@endlessos.org> Helps: #1264
| * | | | | | gdbusprivate: Ensure data->task is cleared when it returnsPhilip Withnall2023-04-141-21/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The existing comment in the code was correct that `data` is freed when the task callback is called, because `data` is also pointed to by the `user_data` for the task, and that’s freed at the end of the callback. So the existing code was correct to take a copy of `data->task` before calling `g_task_return_*()`. After calling `g_task_return_*()`, the existing code unreffed the task (which is correct), but then didn’t clear the `data->task` pointer, leaving `data->task` dangling. That could cause a use-after-free or a double-unref. Avoid that risk by explicitly clearing `data->task` before calling `g_task_return_*()`. After some testing, it turns out this doesn’t actually fix any bugs, but it’s still a good robustness improvement. Signed-off-by: Philip Withnall <pwithnall@endlessos.org> Helps: #1264
| * | | | | | gdbusprivate: Improve docs on message ownership in MessageToWriteDataPhilip Withnall2023-02-231-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This doesn’t introduce any functional changes, but should make the code a little clearer. Drive-by improvements while trying to debug #1264. Signed-off-by: Philip Withnall <pwithnall@endlessos.org> Helps: #1264
| * | | | | | gdbusconnection: Improve docs of message ownership in closuresPhilip Withnall2023-02-231-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This introduces no functional changes, but makes it a little clearer how the ownership of these `GDBusMessage` instances works. The free function is changed to `g_clear_object()` to avoid the possibility of somehow using the messages after freeing them. Basically just some drive-by docs improvements while trying to debug issue #1264. Signed-off-by: Philip Withnall <pwithnall@endlessos.org> Helps: #1264
| * | | | | | gdbusconnection: Fix the type of a free functionPhilip Withnall2023-02-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This didn’t actually cause any observable bugs, since the structures of `PropertyData` and `PropertyGetAllData` were equivalent for the members which the free function touches. Definitely should be fixed though. Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
| * | | | | | gdbusconnection: Fix double unref on timeout/cancel sending a messagePhilip Withnall2023-02-231-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This appears to fix an intermittent failure seen when sending a D-Bus message with either of a cancellable or a timeout set. In particular, I can reliably reproduce it with: ``` meson test gdbus-test-codegen-min-required-2-64 --repeat 10000 ``` It can be caught easily with asan when reproduced. Tracking down the location of the refcount mismatch was a little tricky, but was simplified by replacing a load of `g_object_ref (message)` calls with `g_dbus_message_copy (message, NULL)` to switch `GDBusMessage` handling to using copy semantics. This allowed asan to home in on where the refcount mismatch was happening. The problem was that `send_message_data_deliver_error()` takes ownership of the `GTask` passed to it, but the `send_message_with_replace_cancelled_idle_cb()` and `send_message_with_reply_timeout_cb()` functions which were calling it, were not passing in a strong reference as they should have. Another approach to fixing this would have been to change the transfer semantics of `send_message_data_deliver_error()` so it was `(transfer none)` on its `GTask`. That would probably have resulted in cleaner code, but would have been a lot harder to verify/review the fix, and easier to inadvertently introduce new bugs. The fact that the bug was only triggered by the cancellation and timeout callbacks explains why it was intermittent: these code paths are typically never hit, but the timeout path may sometimes be hit on a very slow test run. Signed-off-by: Philip Withnall <pwithnall@endlessos.org> Fixes: #1264
* | | | | | | Merge branch '799-app-info-monitor-docs' into 'main'Emmanuele Bassi2023-04-132-33/+102
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | gappinfo: Clarify one-shot behaviour of GAppInfoMonitor::changed in docs Closes #799 See merge request GNOME/glib!3346
| * | | | | | | tests: Add some explanatory comments to appmonitor testPhilip Withnall2023-03-221-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This should split the code up into logical blocks a bit better, and make it a bit easier to see what the test is doing at a glance. Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
| * | | | | | | tests: Port appmonitor test from GMainLoop to using GMainContext directlyPhilip Withnall2023-03-221-17/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes the exit conditions for each main loop clearer, and eliminates use of global variables. It introduces no functional changes. Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
| * | | | | | | tests: Fix non-removal of a timeout in appmonitor testPhilip Withnall2023-03-221-3/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the first part of the test takes less than 3s (which is normal), the timeout for it is not removed, and could spuriously fire during the second part of the test, causing a false failure. Instead of relying on source IDs, just use (and explicitly destroy) a `GSource` for the timeouts. Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
| * | | | | | | tests: Fix a FIXME in the appmonitor testPhilip Withnall2023-03-221-7/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The test thought that calling `g_app_info_get()` was a bit of a hack, but actually it (or calling another `g_app_info_*()` function) is the right way to use the `GAppInfoMonitor` API. See the documentation improvements a couple of commits back for details. The remaining FIXME higher up in the test should probably be fixed by getting `g_app_info_monitor_get()` to arm the signal. That requires changes in `g_app_info_monitor_get()` to call `desktop_file_dir_init()`. That will have to happen another time. Signed-off-by: Philip Withnall <pwithnall@endlessos.org> Helps: #799
| * | | | | | | tests: Use g_assert_*() rather than g_assert() in appmonitor testsPhilip Withnall2023-03-221-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It won’t get compiled out with `G_DISABLE_ASSERT`. Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
| * | | | | | | tests: Add copyright/licensing header to appmonitor testsPhilip Withnall2023-03-221-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is put together through git archaeology: ``` git log gio/tests/appmonitor.c ``` The following commits were too trivial to have meaningful copyright: - 54047080e963b2d6c3f966340dcd9d788b73ac9c - 4e7d22e268a4e06beb1c09585a48288c31004da5 - f2c1cfe8c770f73367a021044bcdda550348714c - f8f344923eba57ca13d82e53f3e7b82633179f43 - 3ce00b29ec0bb240412506affb5c65bdb18c7ad3 - 346836962521cce76f3cbd53259a985d3bef6a2a - e9d9edde824df1229bc5539610b98c98013e93aa Signed-off-by: Philip Withnall <pwithnall@endlessos.org> Helps: #1415
| * | | | | | | gappinfo: Clarify one-shot behaviour of GAppInfoMonitor::changed in docsPhilip Withnall2023-03-221-7/+28
| | |_|/ / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Philip Withnall <pwithnall@endlessos.org> Fixes: #799
* | | | | | | Merge branch '322-proxy-subclass-example' into 'main'Emmanuele Bassi2023-04-131-0/+102
|\ \ \ \ \ \ \ | |_|_|_|_|/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | tests: Finish update of gdbus-example-proxy-subclass to new GDBus API Closes #322 See merge request GNOME/glib!3332
| * | | | | | tests: Finish update of gdbus-example-proxy-subclass to new GDBus APIColin Walters2023-03-201-0/+102
| | |_|/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes bug #624696. Incorporates a more recent change from 1dc774a653e992e1 to drop the `g_type_init()` call, and reformats the indentation a bit. Fixes: #322
* | | | | | Fix multiple definition errorDan Yeaw2023-04-071-1/+1
| |_|_|_|/ |/| | | | | | | | | Fixes #2966 when compiling with GCC < 9.1 or Clang < 14.0.
* | | | | Merge branch 'drop-gitignore' into 'main'Marco Trevisan2023-04-051-146/+0
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | build: Drop old .gitignore files from test directories See merge request GNOME/glib!3333
| * | | | | build: Drop old .gitignore files from test directoriesPhilip Withnall2023-03-201-146/+0
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | They just listed built files. Since the move to Meson, these are all kept in a separate build directory, not the source tree, so don’t need to be ignored. Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
* | | | | Merge branch '2952-pollable-docs' into 'main'Marco Trevisan2023-04-052-0/+31
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | gpollable: Clarify that can_poll() must be called before other methods Closes #2952 See merge request GNOME/glib!3348
| * | | | | gpollable: Clarify that can_poll() must be called before other methodsPhilip Withnall2023-03-232-0/+31
| | |/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Both `GPollableInputStream` and `GPollableOutputStream` are dynamic interfaces, in that their implementation on a class may only be functional if certain prerequisites are met at runtime. For example, a `GConverterInputStream` is only pollable if its base stream is pollable, and that’s determined at runtime rather than compile time. As such, both interfaces have a `can_poll()` method. If that method returns `FALSE`, the behaviour of all other methods on the interface is undefined. That was mentioned in the documentation for `can_poll()`, but not any of the other documentation for the interfaces, which made it a bit hard to find. Mention it more widely. Signed-off-by: Philip Withnall <pwithnall@endlessos.org> Fixes: #2952
* | | | | Merge branch '2960-debug-controller-docs' into 'main'Marco Trevisan2023-04-051-3/+4
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | gdebugcontrollerdbus: Fix incorrect paragraph on auth in documentation Closes #2960 See merge request GNOME/glib!3354
| * | | | | gdebugcontrollerdbus: Fix incorrect paragraph on auth in documentationPhilip Withnall2023-03-291-3/+4
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Philip Withnall <pwithnall@endlessos.org> Fixes: #2960
* | | | | GWin32AppInfo: Fix g_str_has_prefix() checkLuca Bacci2023-04-051-1/+1
|/ / / / | | | | | | | | | | | | Fixes https://gitlab.gnome.org/GNOME/glib/-/issues/2972
* | | | gfileinfo: Temporarily downgrade missing attribute criticals to debugsPhilip Withnall2023-03-211-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This partially reverts ed8e86a7d4. The change to add the criticals (commit ed8e86a7d4) is correct, but landed too late in the cycle. Let’s downgrade the criticals to debugs for now, to stop applications seeing a lot of new criticals in their output. Those criticals are particularly disruptive for command line applications and unit tests. Early in the next cycle, the debugs will be re-upgraded to criticals. This will give applications a whole additional cycle to fix their ambiguous use of API. It turned out that a lot of applications have latent bugs around calling `g_file_info_get_*()` without checking whether an attribute is set first, and were hence relying on the ‘unknown’ return value also being an appropriate default for them. This was compounded by the fact that several non-local GVFS backends were not setting `GFileInfo` attributes all the time, which caused the ‘missing attribute’ code path to be hit more frequently. For example, they would only call `g_file_info_set_is_hidden()` with a true value and never bother with a false one. It was further compounded by the fact that, while this change landed for the 2.75.4 release, there did not seem to be extensive integration testing of that release, and distributions and downstreams went straight to 2.76.0. That meant we missed the window between 2.75.4 and 2.76.0 to change, fix or revert this behaviour. GLib relies on distros and downstreams doing integration testing of unstable releases. We test with downstream GNOME as part of gnome-build-meta, but do not have the resources to do integration testing for everybody. Signed-off-by: Philip Withnall <pwithnall@endlessos.org> See: #2907 See: #2932 See: #2934 See: #2945 See: #2948
* | | | Merge branch '352-file-enumerator-docs' into 'main'Philip Withnall2023-03-211-7/+52
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | gfileenumerator: Clarify termination condition for next_files_async() Closes #352 See merge request GNOME/glib!3339
| * | | | gfileenumerator: Add an example of using next_files_async() to the docsPhilip Withnall2023-03-211-0/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is written in pseudocode C which omits all the callback boilerplate for the async calls. This should hopefully make the overall structure of the loop more obvious. Signed-off-by: Philip Withnall <pwithnall@endlessos.org> Helps: #352
| * | | | gfileenumerator: Clarify termination condition for next_files_async()Owen Taylor2023-03-211-7/+9
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As suggested on #352 by Owen Taylor (commit put together by Philip Withnall, but in Owen’s name as it’s his wording). Signed-off-by: Philip Withnall <pwithnall@endlessos.org> Fixes: #352
* | | | gfileinfo: Zero GTimeVal when failing g_file_info_get_modification_time()Philip Withnall2023-03-211-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before commit ed8e86a7d4, this function would have silently returned a zero-valued `GTimeVal` if the correct attributes weren’t present. That partially regressed in commit ed8e86a7d4, which made it return with a critical warning, but without zeroing the `GTimeVal`. The critical warning can be ignored by users (it doesn’t abort the process unless `G_DEBUG=fatal-criticals` is set), but the change in behaviour of zeroing the `GTimeVal` could cause bugs. See: #2907 Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
* | | | gpollfilemonitor: Add missing attribute checks for g_file_info_get_size()Philip Withnall2023-03-211-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | Missed from the fixes for #2907. Signed-off-by: Philip Withnall <pwithnall@endlessos.org>