diff options
author | Simon McVittie <smcv@collabora.com> | 2021-04-14 12:43:34 +0100 |
---|---|---|
committer | Alexander Larsson <alexander.larsson@gmail.com> | 2021-04-15 18:05:16 +0200 |
commit | f508cf1767315938a6cd06dec70ba264fe46d8ad (patch) | |
tree | b1c274f76fb7d6f7c5e1054475b68f6b7f8037e9 | |
parent | 725efe7ae73de3b78b92b0045b65a68383756e0f (diff) | |
download | flatpak-f508cf1767315938a6cd06dec70ba264fe46d8ad.tar.gz |
system-helper: Move D-Bus names and paths to a header file
Signed-off-by: Simon McVittie <smcv@collabora.com>
-rw-r--r-- | common/flatpak-dir.c | 7 | ||||
-rw-r--r-- | system-helper/Makefile.am.inc | 1 | ||||
-rw-r--r-- | system-helper/flatpak-system-helper.c | 5 | ||||
-rw-r--r-- | system-helper/flatpak-system-helper.h | 25 |
4 files changed, 33 insertions, 5 deletions
diff --git a/common/flatpak-dir.c b/common/flatpak-dir.c index 7fbe3493..712c1aff 100644 --- a/common/flatpak-dir.c +++ b/common/flatpak-dir.c @@ -56,6 +56,7 @@ #include "flatpak-variant-private.h" #include "flatpak-variant-impl-private.h" #include "libglnx/libglnx.h" +#include "system-helper/flatpak-system-helper.h" #ifdef HAVE_LIBMALCONTENT #include <libmalcontent/malcontent.h> @@ -2047,9 +2048,9 @@ flatpak_dir_system_helper_call (FlatpakDir *self, g_debug ("Calling system helper: %s", method_name); res = g_dbus_connection_call_with_unix_fd_list_sync (self->system_helper_bus, - "org.freedesktop.Flatpak.SystemHelper", - "/org/freedesktop/Flatpak/SystemHelper", - "org.freedesktop.Flatpak.SystemHelper", + FLATPAK_SYSTEM_HELPER_BUS_NAME, + FLATPAK_SYSTEM_HELPER_PATH, + FLATPAK_SYSTEM_HELPER_INTERFACE, method_name, parameters, reply_type, diff --git a/system-helper/Makefile.am.inc b/system-helper/Makefile.am.inc index c0355aac..d651294b 100644 --- a/system-helper/Makefile.am.inc +++ b/system-helper/Makefile.am.inc @@ -16,6 +16,7 @@ systemdsystemunit_DATA += system-helper/flatpak-system-helper.service flatpak_system_helper_SOURCES = \ system-helper/flatpak-system-helper.c \ + system-helper/flatpak-system-helper.h \ $(NULL) flatpak_system_helper_LDADD = $(BASE_LIBS) $(OSTREE_LIBS) $(JSON_LIBS) $(POLKIT_LIBS) libflatpak-common.la libflatpak-common-base.la libglnx.la diff --git a/system-helper/flatpak-system-helper.c b/system-helper/flatpak-system-helper.c index f7e04897..f83ecdf4 100644 --- a/system-helper/flatpak-system-helper.c +++ b/system-helper/flatpak-system-helper.c @@ -39,6 +39,7 @@ #include "flatpak-error.h" #include "flatpak-oci-registry-private.h" #include "flatpak-progress-private.h" +#include "flatpak-system-helper.h" #include "flatpak-utils-base-private.h" #include "flatpak-utils-private.h" @@ -2236,7 +2237,7 @@ on_bus_acquired (GDBusConnection *connection, if (!g_dbus_interface_skeleton_export (G_DBUS_INTERFACE_SKELETON (helper), connection, - "/org/freedesktop/Flatpak/SystemHelper", + FLATPAK_SYSTEM_HELPER_PATH, &error)) { g_warning ("error: %s", error->message); @@ -2412,7 +2413,7 @@ main (int argc, flags |= G_BUS_NAME_OWNER_FLAGS_REPLACE; name_owner_id = g_bus_own_name (on_session_bus ? G_BUS_TYPE_SESSION : G_BUS_TYPE_SYSTEM, - "org.freedesktop.Flatpak.SystemHelper", + FLATPAK_SYSTEM_HELPER_BUS_NAME, flags, on_bus_acquired, on_name_acquired, diff --git a/system-helper/flatpak-system-helper.h b/system-helper/flatpak-system-helper.h new file mode 100644 index 00000000..12a0b170 --- /dev/null +++ b/system-helper/flatpak-system-helper.h @@ -0,0 +1,25 @@ +/* + * Copyright © 2021 Collabora Ltd. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. If not, see <http://www.gnu.org/licenses/>. + */ + +#ifndef __FLATPAK_SYSTEM_HELPER_H__ +#define __FLATPAK_SYSTEM_HELPER_H__ + +#define FLATPAK_SYSTEM_HELPER_BUS_NAME "org.freedesktop.Flatpak.SystemHelper" +#define FLATPAK_SYSTEM_HELPER_PATH "/org/freedesktop/Flatpak/SystemHelper" +#define FLATPAK_SYSTEM_HELPER_INTERFACE FLATPAK_SYSTEM_HELPER_BUS_NAME + +#endif |