summaryrefslogtreecommitdiff
path: root/src/seat.c
diff options
context:
space:
mode:
authorMartin Pitt <martin.pitt@ubuntu.com>2015-04-08 14:56:19 +0200
committerMartin Pitt <martin.pitt@ubuntu.com>2015-04-08 14:56:19 +0200
commit369fcf25cc169883ba0ba2d133487fb47b7d5dbb (patch)
tree6f944227f691b77f99e65f71054f969002be84ad /src/seat.c
parentdfff01b6c63529ea265e4a0046454dfca18e2cbb (diff)
downloadlightdm-git-369fcf25cc169883ba0ba2d133487fb47b7d5dbb.tar.gz
Quiesce initctl errors when not running under upstart
Diffstat (limited to 'src/seat.c')
-rw-r--r--src/seat.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/seat.c b/src/seat.c
index b8473327..f9b149dd 100644
--- a/src/seat.c
+++ b/src/seat.c
@@ -394,13 +394,15 @@ emit_upstart_signal (const gchar *signal)
{
g_return_if_fail (signal != NULL);
g_return_if_fail (signal[0] != 0);
+ const gchar* argv[] = {"initctl", "-q", "emit", signal, "DISPLAY_MANAGER=lightdm", NULL};
if (getuid () != 0)
return;
- gchar *cmd = g_strdup_printf ("initctl -q emit %s DISPLAY_MANAGER=lightdm", signal);
- g_spawn_command_line_async (cmd, NULL); /* OK if it fails, probably not installed */
- g_free (cmd);
+ /* OK if it fails, probably not installed or not running upstart */
+ g_spawn_async (NULL, argv, NULL,
+ G_SPAWN_SEARCH_PATH | G_SPAWN_STDERR_TO_DEV_NULL,
+ NULL, NULL, NULL, NULL);
}
static void