[glib/glib-2-66: 1/2] glocalfileinfo: Fix use of fstatat() on macOS < 10.10
- From: Sebastian Dröge <sdroege src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib/glib-2-66: 1/2] glocalfileinfo: Fix use of fstatat() on macOS < 10.10
- Date: Wed, 7 Oct 2020 14:22:10 +0000 (UTC)
commit d96a455b91737181d4730f6dc581d35e2b779f4d
Author: Philip Withnall <pwithnall endlessos org>
Date: Tue Oct 6 10:25:02 2020 +0100
glocalfileinfo: Fix use of fstatat() on macOS < 10.10
`g_local_file_fstatat()` needs to fall back to returning an error if
`fstatat()` isn’t defined, which is the case on older versions of macOS
(as well as Windows, which was already handled). Callers shouldn’t call
`g_local_file_fstatat()` in these cases. (That’s already the case.)
Signed-off-by: Philip Withnall <pwithnall endlessos org>
Fixes: #2203
gio/glocalfileinfo.h | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/gio/glocalfileinfo.h b/gio/glocalfileinfo.h
index f2beb70cd..ff3e4994f 100644
--- a/gio/glocalfileinfo.h
+++ b/gio/glocalfileinfo.h
@@ -236,12 +236,12 @@ g_local_file_fstatat (int fd,
return -1;
}
-#ifdef G_OS_WIN32
- /* Currently not supported on Windows */
+#if !defined(G_OS_WIN32) && defined(AT_FDCWD)
+ return fstatat (fd, path, stat_buf, flags);
+#else
+ /* Currently not supported on Windows or macOS < 10.10 */
errno = ENOSYS;
return -1;
-#else
- return fstatat (fd, path, stat_buf, flags);
#endif
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]