aboutsummaryrefslogtreecommitdiff
path: root/qga/service-win32.c
diff options
context:
space:
mode:
authorLaszlo Ersek <lersek@redhat.com>2013-05-18 06:31:53 +0200
committerMichael Roth <mdroth@linux.vnet.ibm.com>2013-07-23 12:01:16 -0500
commit31c6ed2077377b7313b28188a7811a9be866a3e4 (patch)
tree8d2e289e4e2ffef066977bffa35f2f9aba6bed46 /qga/service-win32.c
parentc432c7d85aac05c8aa1331b038b529042631b206 (diff)
qga: save state directory in ga_install_service()
If the user selects a non-default state directory at service installation time, we should remember it in the registered service. Signed-off-by: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com> (cherry picked from commit a839ee77c786a8200c76ca92f697eebf6bcc9aa3) * modified to save state_dir unconditionally an avoid reliance on uncommitted CSIDL_COMMON_APPDATA dependencies Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Diffstat (limited to 'qga/service-win32.c')
-rw-r--r--qga/service-win32.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/qga/service-win32.c b/qga/service-win32.c
index 8a5de8a8b9..02926abb28 100644
--- a/qga/service-win32.c
+++ b/qga/service-win32.c
@@ -35,7 +35,8 @@ static int printf_win_error(const char *text)
return n;
}
-int ga_install_service(const char *path, const char *logfile)
+int ga_install_service(const char *path, const char *logfile,
+ const char *state_dir)
{
SC_HANDLE manager;
SC_HANDLE service;
@@ -56,6 +57,9 @@ int ga_install_service(const char *path, const char *logfile)
if (logfile) {
g_string_append_printf(cmdline, " -l %s -v", logfile);
}
+ if (state_dir) {
+ g_string_append_printf(cmdline, " -t %s", state_dir);
+ }
g_debug("service's cmdline: %s", cmdline->str);