[glib/wip/pwithnall/backport-2707-macos-local-peerpid-fix-glib-2-72] credentials: macos: check for existence of LOCAL_PEERPID - Fixes build errors for macOS 10.7 and ear




commit e4271674cc2fe2e22412cc04d48ed18f302b52e8
Author: Christopher Nielsen <mascguy github com>
Date:   Tue May 31 17:08:04 2022 -0400

    credentials: macos: check for existence of LOCAL_PEERPID
    - Fixes build errors for macOS 10.7 and earlier, where this is not supported

 gio/gsocket.c | 2 ++
 1 file changed, 2 insertions(+)
---
diff --git a/gio/gsocket.c b/gio/gsocket.c
index 1f2ff3864b..be5b96adf8 100644
--- a/gio/gsocket.c
+++ b/gio/gsocket.c
@@ -6070,12 +6070,14 @@ g_socket_get_credentials (GSocket   *socket,
                                       G_CREDENTIALS_NATIVE_TYPE,
                                       &cred);
 
+#ifdef LOCAL_PEERPID
             if (getsockopt (socket->priv->fd,
                             SOL_LOCAL,
                             LOCAL_PEERPID,
                             &pid,
                             &optlen) == 0)
               _g_credentials_set_local_peerid (ret, pid);
+#endif
           }
         else
           {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]