]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
bus test: Accept GetConnectionUnixProcessID() success on Windows
authorSimon McVittie <smcv@collabora.com>
Thu, 29 Nov 2018 19:24:40 +0000 (19:24 +0000)
committerSimon McVittie <smcv@collabora.com>
Thu, 29 Nov 2018 19:25:57 +0000 (19:25 +0000)
Despite its name, which is a historical quirk, this is now a
generic cross-platform process ID on anything with the concept of
numbered processes. It appears it has actually worked on Windows
since dbus 1.7.x.

Bug: https://gitlab.freedesktop.org/dbus/dbus/issues/239
Signed-off-by: Simon McVittie <smcv@collabora.com>
bus/dispatch.c

index 39d84076bcfb57c9ef4a6571846933836b76dfce..16b6782f58756563b92c674686d5997890e7accc 100644 (file)
@@ -1401,9 +1401,7 @@ check_get_connection_unix_process_id (BusContext     *context,
   dbus_bool_t retval;
   DBusError error;
   const char *base_service_name;
-#ifdef DBUS_UNIX
   dbus_uint32_t pid;
-#endif
 
   retval = FALSE;
   dbus_error_init (&error);
@@ -1471,15 +1469,6 @@ check_get_connection_unix_process_id (BusContext     *context,
         {
           ; /* good, this is a valid response */
         }
-#ifdef DBUS_WIN
-      else if (dbus_message_is_error (message, DBUS_ERROR_UNIX_PROCESS_ID_UNKNOWN))
-        {
-          /* We are expecting this error, since we know in the test suite we aren't
-           * talking to a client running on UNIX
-           */
-          _dbus_verbose ("Windows correctly does not support GetConnectionUnixProcessID\n");
-        }
-#endif
       else
         {
 #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || \
@@ -1500,10 +1489,6 @@ check_get_connection_unix_process_id (BusContext     *context,
     }
   else
     {
-#ifdef DBUS_WIN
-      warn_unexpected (connection, message, "GetConnectionUnixProcessID to fail on Windows");
-      goto out;
-#else
       if (dbus_message_get_type (message) == DBUS_MESSAGE_TYPE_METHOD_RETURN)
         {
           ; /* good, expected */
@@ -1552,7 +1537,6 @@ check_get_connection_unix_process_id (BusContext     *context,
               goto out;
             }
         }
-#endif /* !DBUS_WIN */
     }
 
   if (!check_no_leftovers (context))