summaryrefslogtreecommitdiff
path: root/system-helper
diff options
context:
space:
mode:
authorSimon McVittie <smcv@collabora.com>2021-04-14 12:43:34 +0100
committerAlexander Larsson <alexander.larsson@gmail.com>2021-04-15 18:05:16 +0200
commitf508cf1767315938a6cd06dec70ba264fe46d8ad (patch)
treeb1c274f76fb7d6f7c5e1054475b68f6b7f8037e9 /system-helper
parent725efe7ae73de3b78b92b0045b65a68383756e0f (diff)
downloadflatpak-f508cf1767315938a6cd06dec70ba264fe46d8ad.tar.gz
system-helper: Move D-Bus names and paths to a header file
Signed-off-by: Simon McVittie <smcv@collabora.com>
Diffstat (limited to 'system-helper')
-rw-r--r--system-helper/Makefile.am.inc1
-rw-r--r--system-helper/flatpak-system-helper.c5
-rw-r--r--system-helper/flatpak-system-helper.h25
3 files changed, 29 insertions, 2 deletions
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