[glib] gdbusmessage: Don’t use major()/minor() if they’re unavailable
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib] gdbusmessage: Don’t use major()/minor() if they’re unavailable
- Date: Fri, 28 Apr 2017 14:26:47 +0000 (UTC)
commit aefffa3fbc3901315fdc5f9957890926fc6eab54
Author: declan <dec1 geoaze com>
Date: Fri Apr 28 15:34:57 2017 +0200
gdbusmessage: Don’t use major()/minor() if they’re unavailable
https://bugzilla.gnome.org/show_bug.cgi?id=777030
gio/gdbusmessage.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/gio/gdbusmessage.c b/gio/gdbusmessage.c
index e41aebd..6f62afb 100644
--- a/gio/gdbusmessage.c
+++ b/gio/gdbusmessage.c
@@ -32,6 +32,8 @@
#include <sys/mkdev.h>
#elif MAJOR_IN_SYSMACROS
#include <sys/sysmacros.h>
+#else
+#define MAJOR_MINOR_NOT_FOUND 1
#endif
#include "gdbusutils.h"
@@ -3475,8 +3477,10 @@ g_dbus_message_print (GDBusMessage *message,
fs = g_string_new (NULL);
if (fstat (fds[n], &statbuf) == 0)
{
+#ifndef MAJOR_MINOR_NOT_FOUND
g_string_append_printf (fs, "%s" "dev=%d:%d", fs->len > 0 ? "," : "",
major (statbuf.st_dev), minor (statbuf.st_dev));
+#endif
g_string_append_printf (fs, "%s" "mode=0%o", fs->len > 0 ? "," : "",
statbuf.st_mode);
g_string_append_printf (fs, "%s" "ino=%" G_GUINT64_FORMAT, fs->len > 0 ? "," : "",
@@ -3485,8 +3489,10 @@ g_dbus_message_print (GDBusMessage *message,
(guint) statbuf.st_uid);
g_string_append_printf (fs, "%s" "gid=%u", fs->len > 0 ? "," : "",
(guint) statbuf.st_gid);
+#ifndef MAJOR_MINOR_NOT_FOUND
g_string_append_printf (fs, "%s" "rdev=%d:%d", fs->len > 0 ? "," : "",
major (statbuf.st_rdev), minor (statbuf.st_rdev));
+#endif
g_string_append_printf (fs, "%s" "size=%" G_GUINT64_FORMAT, fs->len > 0 ? "," : "",
(guint64) statbuf.st_size);
g_string_append_printf (fs, "%s" "atime=%" G_GUINT64_FORMAT, fs->len > 0 ? "," : "",
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]