1. 29 Jun, 2018 3 commits
  2. 27 Jun, 2018 2 commits
  3. 25 Jun, 2018 1 commit
  4. 22 Jun, 2018 1 commit
  5. 21 Jun, 2018 7 commits
  6. 19 Jun, 2018 5 commits
  7. 17 Jun, 2018 3 commits
    • Ting-Wei Lan's avatar
      kqueue: Use the worker context to schedule rescanning of missing files · e714e1e9
      Ting-Wei Lan authored
      This makes it consistent with the file monitor itself, which already
      attaches kqueue event sources to the worker context.
    • Ting-Wei Lan's avatar
      tests: Make testfilemonitor test work with kqueue · 454a9f8d
      Ting-Wei Lan authored
      check_expected_events is heavily modified in this commit to tolerate
      event loss and allow renaming to be reported as creation and deletion.
      This fixes test failure on FreeBSD.
    • Ting-Wei Lan's avatar
      kqueue: Make it possible to pass file monitor tests · 09c019a4
      Ting-Wei Lan authored
      Previously, kqueue file monitor only add event sources for directories
      regardless of the type of the file being monitored. Doing so may be
      possible on inotify, but it is not sufficient on kqueue. Watching a
      directory on kqueue doesn't report changes made to files under it, and
      we must watch files themselves to get notified. This problem is fixed
      by adding a second watch for non-directory file monitors, and the result
      is that we are now able to receive 'CHANGED' and 'ATTRIBUTE_CHANGED'
      events for non-directory files.
      Since having two watches on one file monitor requires many code changes
      to work properly, this commit also changes the following things:
       - NOTE_ALL macro is now replaced by note_all inline function. Since the
         kqueue backend is shared by all BSD operating systems, there are a
         few difference between these systems. It is easier to do '#ifdef'
         check in a function than in a macro.
       - Both g_kqueue_file_monitor_callback and g_kqueue_file_monitor_cancel
         now holds a lock before accessing kqueue_sub structs. This fixes a
         crash when these two functions are called from different threads,
         causing g_kqueue_file_monitor_callback to access freed memory.
       - 'mask' variable in g_kqueue_file_monitor_callback is now removed.
         The usage of 'mask' was wrong because of the 'mask > 0' check.
         'CHANGED' event has value 0 so the 'mask > 0' check made it
         impossible to emit 'CHANGED' events.
       - kqueue-missing scans can now be triggered from the kqueue event
         callback instead of always waiting for 4 seconds.
       - Don't remove a file from kqueue on unlink unless its hard link count
         has dropped to zero.
       - Don't use 'else if' in the check of 'fflags'. It is possible for a
         kevent to have multiple flags set.
       - Don't use g_file_monitor_emit_event directly. Always use
         g_file_monitor_source_handle_event to report events.
         Events submitted to g_file_monitor_emit_event are delivered
         immediately, but events sent to g_file_monitor_source_handle_event
         are scheduled by GLocalFileMonitor. If we mix the two, the order of
         events will be wrong and tests will fail.
       - Report 'CHANGES_DONE_HINT' immediately after 'CREATED' if the file
         created is not a regular file. This is copied from ih_event_callback.
  8. 15 Jun, 2018 2 commits
    • Olivier Crête's avatar
      docs: Change Bugzilla references to GitLab · 8e65417c
      Olivier Crête authored
      Including modifications by Philip Withnall <withnall@endlessm.com>
    • Ondrej Holy's avatar
      gio: Add bash completion for gio tool · e0e0f259
      Ondrej Holy authored
      GVfs utils used to have bash completion, which was pretty useful. However,
      it hasn't been ported to gio tool unfortunately. GLib provides completion
      for various utils already, so it would be nice to provide completion also
      for gio tool. I've updated old bash completion code and merged with some
      my old unmerged fixes.
      The gvfs completion used "gvfs-ls --show-completions" helper. This mentioned
      option hasn't been obviously ported to "gio list" and the proposed completion
      doesn't add this option in "gio list" to not pollute the codes, but maybe it
      is a bit slower as consequence.
      The proposed bash completion suggests subcommands, uris and paths including
      the remote mounts. It contains some workarounds, especially because of proper
      handling of paths with colons and other special chars (like spaces)...
  9. 14 Jun, 2018 6 commits
  10. 13 Jun, 2018 2 commits
    • Will Thompson's avatar
      g_dbus_is_supported_address(): set error if returning FALSE · ba7b035f
      Will Thompson authored
      Previously, calling:
          g_dbus_is_supported_address ("some-imaginary-transport:", NULL)
      correctly returned FALSE; but calling:
          g_dbus_is_supported_address ("some-imaginary-transport:", &error)
      crashed with:
          assertion failed: (ret || (!ret && (error == NULL || *error != NULL)))
      This was because, if the address component did not start with a known
      transport, no error was set. Fix this, reusing an error string used by
      the corresponding else branch in g_dbus_address_connect(), and adjust
      the test to pass both NULL and non-NULL GError **s to this function in
      every test case. This case:
          g_assert (!g_dbus_is_supported_address ("some-imaginary-transport:foo=bar;unix:path=/this/is/valid", NULL));
      would have caught this bug with a non-NULL GError **.
    • Arnaud Rebillout's avatar
      gfdonotificationbackend: Fix possible invalid pointer in dbus callback · 57e070f8
      Arnaud Rebillout authored
      The way things were before: a FreedesktopNotification struct is
      allocated before the dbus call, and this same struct is possibly re-used
      for other dbus calls. If the server becomes unavailable, the callback
      will be invoked after the call times out, which leaves a long time where
      other dbus calls can happen, re-using the same FreedesktopNotification
      as user data. When the first call times out, the callback is invoked,
      and the user data is freed. Subsequent calls that used the same user
      data will time out later on, and try to free a pointer that was already
      freed, hence segfaults.
      This bug can be reproduced in Cinnamon 3.6.7, as mentioned in:
      This commit fixes that by always allocating a new
      FreedesktopNotification before invoking dbus_call(), ensuring that the
      callback always have a valid user data.
      Signed-off-by: Arnaud Rebillout's avatarArnaud Rebillout <elboulangero@gmail.com>
  11. 12 Jun, 2018 1 commit
  12. 11 Jun, 2018 3 commits
    • Jehan's avatar
      gio: fix various "warning: unused variable". · 866275f5
      Jehan authored
    • Jehan's avatar
      gio: UNIX_PATH_MAX may be defined. · f96417e4
      Jehan authored
      On an Android build, API 22, at least, I got a:
      > warning: "UNIX_PATH_MAX" redefined
      We were currently defining it as:
      > #define UNIX_PATH_MAX sizeof (((struct sockaddr_un *) 0)->sun_path)
      Whereas Android's headers define this variable of sockaddr_un as:
      > char sun_path[UNIX_PATH_MAX];
      So by definition, we will still get the right result in the end by just
      using the original value of UNIX_PATH_MAX.
    • Jehan's avatar
      gio: C_IN is defined in recent Android headers. · 63103534
      Jehan authored
      C_IN macro was added years ago in bcbaf1be, using same value as the
      internal code of Android with the reasonning that "some parts of the API
      used by the resolver objects is not public in the Android NDK (yet)".
      Well since then things are changed, since it is definitely available (at
      least on the API 22 of Android which I am using) in the public header
      Let's just add a #ifndef to handle both cases when you build with an
      older or recent API.
  13. 10 Jun, 2018 1 commit
    • Emmanuele Bassi's avatar
      Classify the tests · 16d1a3d2
      Emmanuele Bassi authored
      Meson has the ability to classify tests according to "suites", a list of
      tags. This is especially useful when we want to run specific sets of
      tests — e.g. only GLib's tests — instead of the whole test suite. It
      also allows us to classify special tests, like "slow" ones, so that we
      can only run them when needed.
  14. 09 Jun, 2018 2 commits
    • Ting-Wei Lan's avatar
      socket: Fix get_available_bytes on systems other than Linux and Windows · 293c103a
      Ting-Wei Lan authored
      FIONREAD ioctl on Linux reports the size of payload on UDP sockets.
      However, other systems usually add internal header size to the reported
      size, which vary between different operating systems and socket types.
      To make it work on more systems, we should follow what we do on Windows
      instead of using this unreliable FIONREAD ioctl.
      This fixes socket test on FreeBSD.
    • Ting-Wei Lan's avatar
      meson: libelf.pc is not always available · a7779033
      Ting-Wei Lan authored
      libelf, just like libc, is not a single project. It is an interface
      which can be implemented independently by different operating systems.
      Therefore, we cannot expect all systems to provide a .pc file, and we
      should fallback to cc.find_library and cc.has_function like what we
      already do in autotools build.
  15. 08 Jun, 2018 1 commit