1. 08 Mar, 2019 1 commit
  2. 22 Feb, 2019 1 commit
    • Tomasz Miąsko's avatar
      glocalfilemonitor: Fix data race in local file monitor · 63368641
      Tomasz Miąsko authored
      Ensure that source is attached to the context before it migth be used
      from another thread, since otherwise operation on source are
      unsynchronized and not thread-safe.
      
      In particular there was a data race between g_source_attach and
      g_source_set_ready_time (used from g_file_monitor_source_handle_event).
      63368641
  3. 02 Aug, 2018 1 commit
    • Ondrej Holy's avatar
      glocalfilemonitor: Fallback to poll file monitor for NFS · 3edc5049
      Ondrej Holy authored
      GLib currently tries to use FAM volume monitor for monitoring files
      within home on NFS. If FAM support is not available, it fallbacks by
      default to GInotifyFileMonitor. I think we should fallback to
      GPollFileMonitor instead, because inotify is not reliable on NFS,
      which may cause issues for dconf. With this patch, it should be safe to
      not build libgiofam and still be sure that dconf works properly if home
      is mounted on NFS. I think this might be a first step to remove FAM
      support from GLib completely, because gamin is buggy and dead for
      several years already. Gamin just polls files on NFS anyway. This
      change applies on files only, because GPollFileMonitor seems doesn't
      support dirs, however it should be enough for dconf. The other
      drawback is that one can't set poll timeout currently. Just a note
      that this can still be overwritten by GIO_USE_FILE_MONITOR.
      3edc5049
  4. 26 Jun, 2018 1 commit
    • Philip Withnall's avatar
      gmain: Add names to various GSources constructed in GLib · 208a6e81
      Philip Withnall authored
      For the purposes of debugging, it is quite useful for every GSource to
      have a name set. Ensure that any GSource we construct inside GLib has a
      name set. For GSources which are then returned to the caller, this name
      can then be overridden with something even more useful by the caller.
      
      Since this data is only used for debugging, avoid doing any allocations
      for it; just use static strings.
      
      #1175
      208a6e81
  5. 18 Apr, 2018 1 commit
  6. 29 May, 2017 1 commit
  7. 16 Dec, 2015 1 commit
  8. 30 Oct, 2015 1 commit
  9. 19 Aug, 2015 1 commit
    • Matthias Clasen's avatar
      inotify: Fix handling of paired events for atomic replace · ac78d141
      Matthias Clasen authored
      After the big file monitoring rewrite, we only put the IN_MOVED_FROM event
      in the queue for such pairs. It matches INOTIFY_DIR_MASK and thus we call
      ip_dispatch_event on it, but that function was filtering it out because
      the filename in the 'from' event is the one of the temp file, not the
      one we are monitoring. That name is in the 'to' event, so compare it as
      well, and let the event passin that case.
      
      There is another instance of this check in glocalfilemonitor.c, which is
      corrected here as well.
      
      https://bugzilla.gnome.org/show_bug.cgi?id=751358
      ac78d141
  10. 06 Jul, 2015 1 commit
  11. 04 May, 2015 1 commit
  12. 26 Mar, 2015 1 commit
    • Allison Karlitskaya's avatar
      file monitors: fix a typo · 706c4d32
      Allison Karlitskaya authored
      Due to a typo, a rename reported via a pair of delete/create events (due
      to the watcher not giving the flag for moves to be paired) was
      accidentally reported as being created with the old name instead of the
      new name.
      
      Fix that.
      706c4d32
  13. 20 Mar, 2015 2 commits
    • Allison Karlitskaya's avatar
      GFileMonitorSource: return "interesting" value · 9adf948a
      Allison Karlitskaya authored
      Return an "interesting" boolean from the event handler function on
      GFileMonitorSource.
      
      An event was "interesting" if it will result in a signal actually being
      dispatched to the user.  It is "uninteresting" if it only hit an
      already-dirty rate limiter.
      
      We will use this information to do some backing off in the backends when
      faced with a flood of uninteresting events.
      9adf948a
    • Allison Karlitskaya's avatar
      substantially rework file monitors · 2737ab32
      Allison Karlitskaya authored
      Remove all event merging and dispatch logic from GFileMonitor.  The only
      implementation of GFileMonitor outside of glib is in gvfs and it already
      does these things properly.
      
      Get rid of GLocalDirectoryMonitor.  We will use a single class,
      GLocalFileMonitor, for both directory and file monitoring.  This will
      prevent every single backend from having to create two objects
      separately (eg: ginotifydirectorymonitor.c and ginotifyfilemonitor.c).
      
      Introduce GFileMonitorSource as a thread-safe cross-context dispatch
      mechanism.  Put it in GLocalFileMonitor.  All backends will be expected
      to dispatch via the source and not touch the GFileMonitor object at all
      from the worker thread.
      
      Remove all construct properties from GLocalFileMonitor and remove the
      "context" construct property from GFileMonitor.  All backends must now
      get the information about what file to monitor from the ->start() call
      which is mandatory to implement.
      
      Remove the implementation of rate limiting in GFileMonitor and add an
      implementation in GLocalFileMonitor.  gvfs never did anything with this
      anyway, but if it wanted to, it would have to implement it for itself.
      This was done in order to get the rate_limit field into the
      GFileMonitorSource so that it could be safely accessed from the worker
      thread.
      
      Expose g_local_file_is_remote() internally for NFS detection.
      
      With the "is_remote" functionality exposed, we can now move all
      functions for creating local file monitors to a proper location in
      glocalfilemonitor.c
      
      Port the inotify backend to adjust to the changes above.  None of the
      other backends are ported yet.  Those will come in future commits.
      2737ab32
  14. 31 Jan, 2014 1 commit
  15. 03 Oct, 2013 2 commits
    • Allison Karlitskaya's avatar
      glocalfile: add private worker monitor APIs · 33762a41
      Allison Karlitskaya authored
      Add a convenient and race-free method of watching local files from the
      GLib worker thread.
      
      Without this, the race-free way to create a monitor that dispatches
      events to the worker thread looked something like this:
      
       - dispatch an idle to the worker thread
       - from the idle, create the monitor and connect signals
       - from the original thread, wait (on a cond?) until the worker thread
         has finished setting up the monitor
       - read the file that you were monitoring
      
      which is just ridiculously complicated...
      
      To use the new API:
      
        monitor = g_local_file_monitor_new_in_worker ("/path/to/some/file",
                                                      G_FILE_MONITOR_NONE,
                                                      &error);
        g_assert_no_error (error);
      
        g_signal_connect (monitor, "changed", G_CALLBACK (callback), NULL);
      
        g_local_file_monitor_start (monitor);
      
      'callback' will run from the GLib worker thread.
      
      This is the reason that the start() call was introduced in the previous
      commit.  The backends that don't use the start() call will have a very
      thin race between creating the monitor and connecting the signal, but
      hopefully they will be fixed soon.
      
      These new APIs will be used (at least) from gdesktopappinfo to watch for
      changes in the desktop file directories.
      
      https://bugzilla.gnome.org/show_bug.cgi?id=704887
      33762a41
    • Allison Karlitskaya's avatar
      local monitors: make more idiomatic use of GObject · b050dc3c
      Allison Karlitskaya authored
      Stop abusing constructor() to do startup work, adding _start() calls
      instead.
      
      The backends themselves still use constructor() although a patch will be
      following to also fix inotify.
      
      The reason for using a separate start() call instead of constructed()
      will become apparent in future commits.
      
      https://bugzilla.gnome.org/show_bug.cgi?id=704887
      b050dc3c
  16. 19 Jan, 2013 2 commits
  17. 07 Jul, 2010 1 commit
  18. 18 Feb, 2010 1 commit
  19. 30 Nov, 2009 1 commit
  20. 01 Jul, 2008 1 commit
    • Cody Russell's avatar
      Moved all relevant typedefs into these files. · 3d93bf69
      Cody Russell authored
      2008-07-01  Cody Russell  <bratsche@gnome.org>
      
              * gio/gioenums.h:
              * gio/giotypes.h:
      	Moved all relevant typedefs into these	files.
      
              * gio/*.[ch]:
      	Updated wrt added files.
      
              Split types into separate file	for easier maintainership. (#538564)
      
      
      svn path=/trunk/; revision=7127
      3d93bf69
  21. 22 Jun, 2008 1 commit
  22. 16 Jun, 2008 2 commits
  23. 28 Jan, 2008 1 commit
    • Alexander Larsson's avatar
      Add registration hooks for extension points. Register the gio extension · bff9eced
      Alexander Larsson authored
      2008-01-28  Alexander Larsson  <alexl@redhat.com>
      
              * giomodule.[ch]:
              * gio.symbols:
      	Add registration hooks for extension points.
      	Register the gio extension points.
      	
              * fam/gfamdirectorymonitor.c:
              * fam/gfamfilemonitor.c:
              * glocaldirectorymonitor.[ch]:
              * glocalfilemonitor.[ch]:
              * gnativevolumemonitor.h:
              * gunionvolumemonitor.c:
              * gunixvolumemonitor.c:
              * gvfs.[ch]:
              * gvolumemonitor.h:
              * inotify/ginotifydirectorymonitor.c:
              * inotify/ginotifyfilemonitor.c:
      	Use the extension points registration instead
      	of g_type_children().
      
      
      svn path=/trunk/; revision=6399
      bff9eced
  24. 21 Jan, 2008 1 commit
    • Matthias Clasen's avatar
      Whitespace cleanups. · 54300dde
      Matthias Clasen authored
      2008-01-21  Matthias Clasen  <mclasen@redhat.com>
      
              * glocal*.c:
              * gvolumemanager.c: Whitespace cleanups.
      
              * glocalfileoutputsteam.c (_g_local_file_output_stream_create):
              Use the right mode when creating the file.
      
      
      
      svn path=/trunk/; revision=6341
      54300dde
  25. 14 Jan, 2008 1 commit
    • Alexander Larsson's avatar
      Add GError to file monitor calls · 3690cb75
      Alexander Larsson authored
      2008-01-14  Alexander Larsson  <alexl@redhat.com>
      
              * gfile.[ch]:
              (g_file_monitor_directory):
              (g_file_monitor_file):
      	Add GError to file monitor calls
      	
              * glocaldirectorymonitor.c:
              * glocaldirectorymonitor.h:
              * glocalfile.c:
              * glocalfilemonitor.c:
              * glocalfilemonitor.h:
              * gunixmounts.c:
      	Update for above change
      
      
      svn path=/trunk/; revision=6306
      3690cb75
  26. 07 Jan, 2008 1 commit
  27. 19 Dec, 2007 1 commit
    • Alexander Larsson's avatar
      Make g_io_modules_load_all_in_directory not unuse loaded modules so that · 28d1c8e0
      Alexander Larsson authored
      2007-12-19  Alexander Larsson  <alexl@redhat.com>
      
              * giomodule.c:
      	Make g_io_modules_load_all_in_directory not unuse
      	loaded modules so that users of it can do stuff
      	before unloading.
      	Init internal "module" types.
      	Initialize static prio and name for types so that
      	we don't have to load modules to get it.
      	
              * gnativevolumemonitor.h:
      	* gvolumemonitor.h:
      	Move is_supported to parent class so that
      	non-native monitors can avoid being initialized
      	too. (For instance GDaemonVolumeMonitor if we're
      	not using GDaemonVfs.)
      	
              * glocaldirectorymonitor.[ch]:
              * glocalfilemonitor.[ch]:
      	* gunionvolumemonitor.c:
              * gunixvolumemonitor.c:
              * gvfs.c:
      	Find plugins using the static prio+name to
      	avoid unnecessarily loading the modules.
      
      
      svn path=/trunk/; revision=6159
      28d1c8e0
  28. 17 Dec, 2007 1 commit
    • Alexander Larsson's avatar
      Add is_supported() to GNativeVolumeMonitorClass so that we can avoid · c4e3cfbf
      Alexander Larsson authored
      2007-12-17  Alexander Larsson  <alexl@redhat.com>
      
              * gnativevolumemonitor.h:
              * gunionvolumemonitor.c:
              * gunixvolumemonitor.c:
      	Add is_supported() to GNativeVolumeMonitorClass so
      	that we can avoid having to create an object to see
      	if the backend is supported at runtime.
      	Also add name member and an env var to pick a specific
      	volume monitor backend.
      	
              * gmountprivate.h:
              * glocalfile.c:
      	Add cancellable to _g_mount_get_for_mount_path()
      	
              * glocaldirectorymonitor.c:
              * glocalfilemonitor.c:
      	Avoid loading and unloading modules while sorting.
      
      
      
      svn path=/trunk/; revision=6144
      c4e3cfbf
  29. 10 Dec, 2007 1 commit
    • 15:08:59  Tim Janik's avatar
      http://mail.gnome.org/archives/gtk-devel-list/2007-October/msg00089.html · cc3de68e
      15:08:59 Tim Janik authored
      2007-12-10 15:08:59  Tim Janik  <timj@imendio.com>
      
              * let g_warn_if_fail replace g_assert as discussed here:
                http://mail.gnome.org/archives/gtk-devel-list/2007-October/msg00089.html
      
              * fix bug #502498: Test framework assertion failures should follow
              gcc error format.
      
              * gmessages.h, gmessages.c: deprecated g_assert_warning() which is
              unused now. removed g_assert*() definitions whcih are provided by 
              gtestutils.h now. added g_warn_if_reached() and g_warn_if_fail()  
              which are recommended as g_assert/g_assert_not_reached replacements
              for non-test programs.
              added g_warn_message() to implement g_warn_*() macros.
              use emacs-next-error friendly formatting for file:line: for warnings.
      
              * gtestutils.h, gtestutils.c: use emacs-next-error friendly formatting.
              implement g_assert_not_reached() with g_assertion_message() and
              g_assert() in terms of g_assertion_message_expr() so we'll be able to
              provide assertion messages in test logs.
      
              * gkeyfile.c, gbookmarkfile.c: changed g_assert*() to g_warn_if_fail()
              or g_return_if_fail() where suitable.
      
              * gio/: changed g_assert to g_warn_if_fail.
      
      
      
      svn path=/trunk/; revision=6086
      cc3de68e
  30. 05 Dec, 2007 2 commits
    • Alexander Larsson's avatar
      Added. · 3869c33a
      Alexander Larsson authored
      2007-12-05  Alexander Larsson  <alexl@redhat.com>
      
              * Makefile.am:
              * giomodule-priv.h: Added.
              * glocaldirectorymonitor.c:
              * glocalfilemonitor.c:
              * gunionvolumemonitor.c:
              * gvfs.c:
      	Actually add the declaration of _g_io_modules_ensure_loaded
      
      
      svn path=/trunk/; revision=6051
      3869c33a
    • Alexander Larsson's avatar
      Fix warnings · 4f039bd4
      Alexander Larsson authored
      2007-12-05  Alexander Larsson  <alexl@redhat.com>
      
              * gdatainputstream.c:
      	Fix warnings
      	
              * gio.symbols:
              * giomodule.[ch]
              * glocaldirectorymonitor.c:
              * glocalfilemonitor.c:
              * gunionvolumemonitor.c:
              * gvfs.c:
      	Make g_io_modules_ensure_loaded a private function and
      	don't pass in the dirname. This means we can do magic
      	directory finding in the win32 version.
      	Export the actual load-modules-in-directory code so that
      	gvfs can reuse that.
      
      
      svn path=/trunk/; revision=6050
      4f039bd4
  31. 30 Nov, 2007 1 commit
  32. 28 Nov, 2007 2 commits
    • Alexander Larsson's avatar
      Removed unnecessary file · d9594f57
      Alexander Larsson authored
      2007-11-28  Alexander Larsson  <alexl@redhat.com>
      
              * Makefile.am:
              * gdriveprivate.h:
      	Removed unnecessary file
      	
              * gdesktopappinfo.[ch]:
              * gdummyfile.[ch]:
              * gfile.c:
              * glocaldirectorymonitor.[ch]:
              * glocalfile.[ch]:
              * glocalfileenumerator.[ch]:
              * glocalfileinputstream.[ch]:
              * glocalfilemonitor.[ch]:
              * glocalfileoutputstream.[ch]:
              * glocalvfs.[ch]:
              * gnativevolumemonitor.c:
              * gpollfilemonitor.[ch]:
              * gunionvolumemonitor.[ch]:
              * gunixdrive.[ch]:
              * gunixvolume.[ch]:
              * gunixvolumemonitor.[ch]:
              * gvfs.c:
              * gvolumeprivate.h:
              * inotify/ginotifydirectorymonitor.[ch]:
              * inotify/ginotifyfilemonitor.[ch]:
              * inotify/inotify-helper.c:
      	Append _ to all internal functions
      	
              * gio.symbols:
      	Add missing symbols
      	Export symbols needed for modules
      
      
      svn path=/trunk/; revision=5977
      d9594f57
    • Alexander Larsson's avatar
      Added. Added. Added. Added. · 7f328023
      Alexander Larsson authored
      2007-11-28  Alexander Larsson  <alexl@redhat.com>
      
              * Makefile.am:
              * abicheck.sh: Added.
              * makegioalias.pl: Added.
              * pltcheck.sh: Added.
              * gio.symbols: Added.
      	* *.c:
              * inotify/*.c
      	Initial work on adding symbol handling.
      
      	* gvfs.h:
      	Correct ifdef guard name
      
              * fam/Makefile.am:
              * inotify/Makefile.am:
              * xdgmime/Makefile.am:
      	Include toplevel Makefile.decl
      
      
      svn path=/trunk/; revision=5972
      7f328023
  33. 26 Nov, 2007 1 commit
    • Alexander Larsson's avatar
      gio/ docs/reference/gio Merged gio-standalone into glib. · 37813437
      Alexander Larsson authored
      2007-11-26  Alexander Larsson  <alexl@redhat.com>
      
              * Makefile.am:
              * configure.in:
              * gio-2.0-uninstalled.pc.in:
              * gio-2.0.pc.in: 
              * gio-unix-2.0-uninstalled.pc.in:
              * gio-unix-2.0.pc.in:
      	* gio/
      	* docs/reference/gio
      	Merged gio-standalone into glib.
      	
              * glib/glibintl.h:
              * glib/gutils.c:
      	Export glib_gettext so that gio can use it
      	Add P_ (using same domain for now)
      	Add I_ as g_intern_static_string
      
      
      svn path=/trunk/; revision=5941
      37813437