1. 31 Aug, 2018 1 commit
  2. 17 Jun, 2018 2 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.
      e714e1e9
    • 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.
      09c019a4
  3. 06 Jun, 2018 2 commits
    • Ting-Wei Lan's avatar
      kqueue: Only fallback to polling on /media and /run/media · 41259ac1
      Ting-Wei Lan authored
      The check in _ke_is_excluded, which causes GKqueueFileMonitor to
      fallback to GPollFileMonitor when it returns TRUE, was made to prevent
      file monitor from blocking unmount of removable drives on systems not
      supporting O_EVTONLY flag in open. However, since g_mount_can_unmount
      always returns TRUE on Unix-like platforms, the check always returns
      TRUE on non-standard mount points, which is very likely to cause all
      programs on the desktop to use the polling fallback if GNOME is
      installed in a different prefix for development. This makes the desktop
      sluggish and results in bad developer experience on *BSD.
      41259ac1
    • Ting-Wei Lan's avatar
      kqueue: Make _ke_is_excluded static · 03883673
      Ting-Wei Lan authored
      It is not used in any other file.
      03883673
  4. 18 May, 2018 2 commits
  5. 02 May, 2018 1 commit
    • Håvard Graff's avatar
      kqueue/meson: add missing dependency · 71fba3b3
      Håvard Graff authored
      gioenumtypes needs to be generated:
      In file included from ../../../../external/glib/gio/kqueue/gkqueuefilemonitor.c:37:
      In file included from ../../../../external/./glib/gio/glocalfilemonitor.h:25:
      In file included from ../../../../external/./glib/gio/gunixmounts.h:24:
      ../../../../external/./glib/gio/gio.h:86:10: fatal error: 'gio/gioenumtypes.h' file not found
      #include <gio/gioenumtypes.h>
               ^~~~~~~~~~~~~~~~~~~~
      
      https://bugzilla.gnome.org/show_bug.cgi?id=794325
      71fba3b3
  6. 23 Apr, 2018 1 commit
  7. 13 Mar, 2018 1 commit
    • Martin Pieuchot's avatar
      kqueue: Multiple fixes and simplifications · aa39a055
      Martin Pieuchot authored
       - Stop using a custom thread for listening to kqueue(2) events.  Instead
         call kevent(2) in non blocking mode in a monitor callback.  Under the
         hood poll(2) is used to figure out if new events are available.
      
       - Do not use a socketpair with a custom protocol requiring 2 supplementary
         context switches per event to commicate between multiple threads.  Calling
         kevent(2), in non blocking mode, to add/remove events is fine from any
         context.
      
       - Add kqueue(2) events without the EV_ONESHOT flag.  This removes a race
         where some notifications were lost because events had to be re-added for
         every new notification.
      
       - Get rid of the global hash table and its associated lock and races.  Use
         the 'cookie' argument of kevent(2) to pass the associated descriptor when
         registering an event.
      
       - Fix _kh_file_appeared_cb() by properly passing a monitor instead of a
         source to g_file_monitor_emit_event().
      
       - Properly refcount sources.
      
       - Remove a lot of abstraction making it harder to fix the remaining issues.
      
      https://bugzilla.gnome.org/show_bug.cgi?id=739424
      aa39a055
  8. 21 Feb, 2018 1 commit
  9. 28 Nov, 2017 1 commit
  10. 13 Jul, 2017 3 commits
    • Patrick Griffis's avatar
      meson: Minor modernizations · d10be610
      Patrick Griffis authored
      d10be610
    • Nirbheek Chauhan's avatar
      meson: Improve MSVC and MinGW support and fix dependencies everywhere · fe2a9887
      Nirbheek Chauhan authored
      Disable gio tests on Windows, fix .gitignore to not ignore
      config.h.meson, and add more things to it.
      
      Rename the library file naming and versioning to match what Autotools
      outputs, e.g., libglib-2.0.so.0.5000.2 on Linux, libglib-2.0-0.dll  and
      glib-2.0-0.dll on Windows with MSVC.
      
      Several more tiny fixes, more executables built and installed, install
      pkg-config and m4 files, fix building of gobject tests.
      
      Changes to gdbus-codegen to support out-of-tree builds without
      environment variables set (which you can't in Meson). We now add the
      build directory to the Python module search path.
      fe2a9887
    • Tim-Philipp Müller's avatar
      meson: Fix glib, add gobject, gio, gthread, gmodule, etc · 21395797
      Tim-Philipp Müller authored
      Several small fixes to the build files.
      
      Lots of tests have also been added, and glib tests pass now.
      21395797
  11. 09 Mar, 2017 1 commit
    • Steven McDonald's avatar
      gio: Always purge kqueue subs from missing list · e305fe97
      Steven McDonald authored
      Previously, _kh_cancel_sub assumed that it only needed to call
      _km_remove if sub did not exist in subs_hash_table. This is erroneous
      because the complementary operation, _km_add_missing, can be called
      from process_kqueue_notifications, in which context sub can *only* have
      come from subs_hash_table.
      
      Since _km_remove is implemented using g_slist_remove, which is
      documented to be a noop if the list does not contain the element to be
      removed, it is safe to call _km_remove unconditionally here.
      
      https://bugzilla.gnome.org/show_bug.cgi?id=778515
      e305fe97
  12. 05 Jun, 2015 1 commit
  13. 20 Mar, 2015 1 commit
  14. 05 Feb, 2015 1 commit
  15. 18 Aug, 2014 1 commit
  16. 01 Feb, 2014 1 commit
  17. 26 Dec, 2013 1 commit
  18. 01 Jun, 2013 1 commit
    • Allison Karlitskaya's avatar
      Rework the build system for a new tests approach · f9eb9eed
      Allison Karlitskaya authored
      Perform a substantial cleanup of the build system with respect to
      building and installing testcases.
      
      First, Makefile.decl has been renamed glib.mk and substantially
      expanded.  We intend to add more stuff here in the future, like canned
      rules for mkenums, marshallers, resources, etc.
      
      By default, tests are no longer compiled as part of 'make'.  They will
      be built when 'make check' is run.  The old behaviour can be obtained
      with --enable-always-build-tests.
      
      --disable-modular-tests is gone (because tests are no longer built by
      default).  There is no longer any way to cause 'make check' to be a
      no-op, but that's not very useful anyway.
      
      A new glibtests.m4 file is introduced.  Along with glib.mk, this
      provides for consistent handling of --enable-installed-tests and
      --enable-always-build-tests (mentioned above).
      
      Port our various test-installing Makefiles to the new framework.
      
      This patch substantially improves the situation in the toplevel tests/
      directory.  Things are now somewhat under control there.  There were
      some tests being built that weren't even being run and we run those now.
      The long-running GObject performance tests in this directory have been
      removed from 'make check' because they take too long.
      
      As an experiment, 'make check' now runs the testcases on win32 builds,
      by default.  We can't run them under gtester (since it uses a pipe to
      communicate with the subprocess) so just toss them in TESTS.  Most of
      them are passing on win32.
      
      Things are not quite done here, but this patch is already a substantial
      improvement.  More to come.
      f9eb9eed
  19. 21 May, 2013 1 commit
    • Dan Winship's avatar
      Use 'dumb quotes' rather than `really dumb quotes' · 4b94c083
      Dan Winship authored
      Back in the far-off twentieth century, it was normal on unix
      workstations for U+0060 GRAVE ACCENT to be drawn as "‛" and for U+0027
      APOSTROPHE to be drawn as "’". This led to the convention of using
      them as poor-man's ‛smart quotes’ in ASCII-only text.
      
      However, "'" is now universally drawn as a vertical line, and "`" at a
      45-degree angle, making them an `odd couple' when used together.
      
      Unfortunately, there are lots of very old strings in glib, and also
      lots of new strings in which people have kept up the old tradition,
      perhaps entirely unaware that it used to not look stupid.
      
      Fix this by just using 'dumb quotes' everywhere.
      
      https://bugzilla.gnome.org/show_bug.cgi?id=700746
      4b94c083
  20. 18 Jan, 2013 1 commit
    • Allison Karlitskaya's avatar
      Fix visibility for glib/ and gio/ submodules · 346aa683
      Allison Karlitskaya authored
      We have various sub directories in glib/ and gio/ (eg: inotify, gnulib,
      pcre, xdgmime, etc.) that build convenience libraries that are then
      included into libglib and libgio.  The files in these directories need
      to be built with the same visibility policy as the files in the first
      level directories, so add CFLAGS for them all.
      
      This wasn't a problem when the visibility flags were set directly in
      CFLAGS but then we had to deal with some modules that we built that we
      explicitly wanted to export symbols from.
      
      For now, we can keep things the way they are because it's less hacky and
      although it's a theoretical hazard to forget these CFLAGS, we rarely add
      new subdirectories to the build.
      346aa683
  21. 14 Jan, 2013 1 commit
  22. 17 Nov, 2012 1 commit
  23. 15 Nov, 2012 1 commit