]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
sysdeps: Don't check for PROC_SUPER_MAGIC if it isn't defined
authorSimon McVittie <smcv@collabora.com>
Mon, 9 Dec 2024 23:22:17 +0000 (23:22 +0000)
committerSimon McVittie <smcv@collabora.com>
Tue, 10 Dec 2024 15:43:43 +0000 (15:43 +0000)
Debian GNU/Hurd has fstatfs() but not PROC_SUPER_MAGIC.

Resolves: https://gitlab.freedesktop.org/dbus/dbus/-/issues/539
Bug-Debian: https://bugs.debian.org/1089641
Signed-off-by: Simon McVittie <smcv@collabora.com>
(cherry picked from commit 5d7b87496f3bb094b926692036ae656c31efdd8e)

dbus/dbus-file-unix.c

index d5fa029e86886a1e57248ff0be508e8dc7b6d2c7..19228a958ee60d23c70829b5a40fdb6c2c0f25e2 100644 (file)
@@ -66,7 +66,7 @@ _dbus_file_get_contents (DBusString       *str,
 {
   int fd;
   struct stat sb;
-#ifdef HAVE_FSTATFS
+#if defined(HAVE_FSTATFS) && defined(PROC_SUPER_MAGIC)
   struct statfs sfs;
 #endif
   int orig_len;
@@ -119,7 +119,7 @@ _dbus_file_get_contents (DBusString       *str,
   /* procfs has different semantics - most files are 0 size,
    * we can do only one read, and at most we can read 4M.
    */
-#ifdef HAVE_FSTATFS
+#if defined(HAVE_FSTATFS) && defined(PROC_SUPER_MAGIC)
   if (sb.st_size == 0)
     {
       if (fstatfs(fd, &sfs) < 0)