glib/gio/inotify
Philip Withnall 5cddde1fb2 Consistently save errno immediately after the operation setting it
Prevent the situation where errno is set by function A, then function B
is called (which is typically _(), but could be anything else) and it
overwrites errno, then errno is checked by the caller.

errno is a horrific API, and we need to be careful to save its value as
soon as a function call (which might set it) returns. i.e. Follow the
pattern:
  int errsv, ret;
  ret = some_call_which_might_set_errno ();
  errsv = errno;

  if (ret < 0)
    puts (strerror (errsv));

This patch implements that pattern throughout GLib. There might be a few
places in the test code which still use errno directly. They should be
ported as necessary. It doesn’t modify all the call sites like this:
  if (some_call_which_might_set_errno () && errno == ESOMETHING)
since the refactoring involved is probably more harmful than beneficial
there. It does, however, refactor other call sites regardless of whether
they were originally buggy.

https://bugzilla.gnome.org/show_bug.cgi?id=785577
2017-08-03 10:21:13 +01:00
..
ginotifyfilemonitor.c gio/inotify/: LGPLv2+ -> LGPLv2.1+ 2017-05-29 19:53:34 +02:00
ginotifyfilemonitor.h gio/inotify/: LGPLv2+ -> LGPLv2.1+ 2017-05-29 19:53:34 +02:00
inotify-helper.c gio/inotify/: LGPLv2+ -> LGPLv2.1+ 2017-05-29 19:53:34 +02:00
inotify-helper.h gio/inotify/: LGPLv2+ -> LGPLv2.1+ 2017-05-29 19:53:34 +02:00
inotify-kernel.c Consistently save errno immediately after the operation setting it 2017-08-03 10:21:13 +01:00
inotify-kernel.h gio/inotify/: LGPLv2+ -> LGPLv2.1+ 2017-05-29 19:53:34 +02:00
inotify-missing.c gio/inotify/: LGPLv2+ -> LGPLv2.1+ 2017-05-29 19:53:34 +02:00
inotify-missing.h gio/inotify/: LGPLv2+ -> LGPLv2.1+ 2017-05-29 19:53:34 +02:00
inotify-path.c gio/inotify/: LGPLv2+ -> LGPLv2.1+ 2017-05-29 19:53:34 +02:00
inotify-path.h gio/inotify/: LGPLv2+ -> LGPLv2.1+ 2017-05-29 19:53:34 +02:00
inotify-sub.c gio/inotify/: LGPLv2+ -> LGPLv2.1+ 2017-05-29 19:53:34 +02:00
inotify-sub.h gio/inotify/: LGPLv2+ -> LGPLv2.1+ 2017-05-29 19:53:34 +02:00
Makefile.am substantially rework file monitors 2015-03-20 11:59:47 -04:00
meson.build meson: Minor modernizations 2017-07-13 19:03:39 -04:00