Commit Graph

5 Commits

Author SHA1 Message Date
Will Thompson
016ea9168b errors: don't use 'static inline' on varargs functions
This caused GCC 6.3.0 -Winline to complain:

    ../../../ext/libglnx/glnx-errors.h:169:1: warning: function
        ‘glnx_throw_errno_prefix’ can never be inlined because it uses
        variable argument lists [-Winline]
     glnx_throw_errno_prefix (GError **error, const char *fmt, ...)
     ^~~~~~~~~~~~~~~~~~~~~~~
    ../../../ext/libglnx/glnx-errors.h:169:1: warning: inlining failed
        in call to ‘glnx_throw_errno_prefix’: function not inlinable
        [-Winline]
2017-11-02 17:14:06 +00:00
Jonathan Lebon
32231fdb52 glnx-errors.h: add a glnx_throw_prefix() variant
For completeness. It just looks much cleaner than doing the `, FALSE`
trick. It also takes care of appending the ': ' for you like its errno
version.
2017-05-11 12:34:02 -04:00
Colin Walters
074236b88d errors: Add new glnx_throw_errno{,_prefix}() APIs
We have a *lot* of code of the form:

```
if (unlinkat (fd, pathname) < 0)
  {
     glnx_set_error_from_errno (error);
     goto out;
  }
```

After conversion to `return FALSE style` which is in progress, it's way shorter,
and clearer like this:

```
if (unlinkat (fd, pathname) < 0)
  return glnx_throw_errno (error);
```
2017-03-22 11:03:32 -04:00
Matthew Barnes
fa43744c05 Fix includes when relying on backported g_autoptr() 2015-02-18 16:45:45 -05:00
Colin Walters
8e9a171ec4 Import directory iteration, errno handling, and shutil from libgsystem 2015-02-15 11:53:34 -05:00