summaryrefslogtreecommitdiff
path: root/privileged_startx
diff options
context:
space:
mode:
authorJeremy Huddleston <jeremyhu@freedesktop.org>2009-09-02 10:43:25 -0700
committerJeremy Huddleston <jeremyhu@freedesktop.org>2009-09-02 10:43:25 -0700
commit78d181dc74ffb3e67ee0d90780b86e00e03073eb (patch)
treeaf4fc08567fb47e2b7f8c053cdb2dedd5174d5f8 /privileged_startx
parent33c3dae16b632ab56b6b361273a48079eb0a41c4 (diff)
launchd: Added --with-launchd-id-prefix option to set non-standard launchd id prefix (org.x is still default)
Diffstat (limited to 'privileged_startx')
-rw-r--r--privileged_startx/Makefile.am7
-rw-r--r--privileged_startx/org.x.privileged_startx.plist.cpp4
-rw-r--r--privileged_startx/privileged_startx_types.h6
-rw-r--r--privileged_startx/server.c6
4 files changed, 17 insertions, 6 deletions
diff --git a/privileged_startx/Makefile.am b/privileged_startx/Makefile.am
index 2d68544..453f6e7 100644
--- a/privileged_startx/Makefile.am
+++ b/privileged_startx/Makefile.am
@@ -34,7 +34,7 @@ xinitrc_PROGRAMS = privileged_startx
privstartx_SCRIPTS = 10-tmpdirs 20-font_cache
AM_CPPFLAGS = -DXINITDIR=\"$(xinitrcdir)\" -DSCRIPTDIR=\"$(privstartxdir)\" -DBINDIR=\"$(bindir)\"
-CPP_FILES_FLAGS = -DXINITDIR="$(xinitrcdir)" -DSCRIPTDIR="$(privstartxdir)" -DBINDIR="$(bindir)"
+CPP_FILES_FLAGS = -DXINITDIR="$(xinitrcdir)" -DSCRIPTDIR="$(privstartxdir)" -DBINDIR="$(bindir)" -DLAUNCHD_ID_PREFIX="$(launchdidprefix)"
if TIGER_LAUNCHD
CPP_FILES_FLAGS += -DTIGER_LAUNCHD
@@ -55,7 +55,10 @@ BUILT_SOURCES = \
privileged_startxServer.h \
privileged_startx.h
-launchdaemons_PRE = org.x.privileged_startx.plist.cpp
+$(launchdidprefix).privileged_startx.plist.cpp: org.x.privileged_startx.plist.cpp
+ cp $< $@
+
+launchdaemons_PRE = $(launchdidprefix).privileged_startx.plist.cpp
launchdaemons_DATA = $(launchdaemons_PRE:plist.cpp=plist)
10-tmpdirs: 10-tmpdirs.cpp Makefile
diff --git a/privileged_startx/org.x.privileged_startx.plist.cpp b/privileged_startx/org.x.privileged_startx.plist.cpp
index 7400cc4..02e1cce 100644
--- a/privileged_startx/org.x.privileged_startx.plist.cpp
+++ b/privileged_startx/org.x.privileged_startx.plist.cpp
@@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<key>Label</key>
- <string>org.x.privileged_startx</string>
+ <string>LAUNCHD_ID_PREFIX.privileged_startx</string>
<key>ProgramArguments</key>
<array>
<string>XINITDIR/privileged_startx</string>
@@ -16,7 +16,7 @@
#else
<key>MachServices</key>
<dict>
- <key>org.x.privileged_startx</key>
+ <key>LAUNCHD_ID_PREFIX.privileged_startx</key>
<true/>
</dict>
<key>TimeOut</key>
diff --git a/privileged_startx/privileged_startx_types.h b/privileged_startx/privileged_startx_types.h
index fef7195..8928e64 100644
--- a/privileged_startx/privileged_startx_types.h
+++ b/privileged_startx/privileged_startx_types.h
@@ -1,6 +1,10 @@
#ifndef _PRIV_STARTX_TYPES_H_
#define _PRIV_STARTX_TYPES_H_
-#define BOOTSTRAP_NAME "org.x.privileged_startx"
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#define BOOTSTRAP_NAME LAUNCHD_ID_PREFIX".privileged_startx"
#endif
diff --git a/privileged_startx/server.c b/privileged_startx/server.c
index 6dd4f2b..ee508db 100644
--- a/privileged_startx/server.c
+++ b/privileged_startx/server.c
@@ -26,6 +26,10 @@
* prior written authorization.
*/
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <mach/mach.h>
#include <mach/mach_error.h>
#include <servers/bootstrap.h>
@@ -153,7 +157,7 @@ int server_main(const char *dir) {
mp = launch_data_get_machport(svc);
#else
- mp = checkin_or_register("org.x.privileged_startx");
+ mp = checkin_or_register(LAUNCHD_ID_PREFIX".privileged_startx");
#endif
if (mp == MACH_PORT_NULL) {