summaryrefslogtreecommitdiffstats
path: root/sesman
diff options
context:
space:
mode:
authorJay Sorg <jay.sorg@gmail.com>2012-02-13 23:31:11 -0800
committerJay Sorg <jay.sorg@gmail.com>2012-02-13 23:31:11 -0800
commit93939893de95a8419ba067b358c951b036d78cc7 (patch)
treea8746046e96b7ce1d1b3d2b0753c7a98d4fc0833 /sesman
parent968a293e193a41a3230a99c09008273e3d9fcc56 (diff)
downloadxrdp-proprietary-93939893de95a8419ba067b358c951b036d78cc7.tar.gz
xrdp-proprietary-93939893de95a8419ba067b358c951b036d78cc7.zip
remove old freerdp dir
Diffstat (limited to 'sesman')
-rw-r--r--sesman/sesman.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/sesman/sesman.c b/sesman/sesman.c
index 7bf794e1..5a230417 100644
--- a/sesman/sesman.c
+++ b/sesman/sesman.c
@@ -167,6 +167,7 @@ main(int argc, char** argv)
g_printf("-k, --kill kills running sesman\n");
g_printf("-h, --help shows this help\n");
g_printf("if no command is specified, sesman is started in background");
+ g_deinit();
g_exit(0);
}
else if ((2 == argc) && ((0 == g_strcasecmp(argv[1], "--kill")) ||
@@ -178,6 +179,7 @@ main(int argc, char** argv)
if (!g_file_exist(pid_file))
{
g_printf("sesman is not running (pid file not found - %s)\n", pid_file);
+ g_deinit();
g_exit(1);
}
@@ -194,6 +196,7 @@ main(int argc, char** argv)
{
g_printf("error reading pid file: %s\n", g_get_strerror());
g_file_close(fd);
+ g_deinit();
g_exit(error);
}
g_file_close(fd);
@@ -208,7 +211,7 @@ main(int argc, char** argv)
{
g_file_delete(pid_file);
}
-
+ g_deinit();
g_exit(error);
}
else
@@ -217,6 +220,7 @@ main(int argc, char** argv)
g_printf("sesman - xrdp session manager\n\n");
g_printf("error: invalid command line\n");
g_printf("usage: sesman [ --nodaemon | --kill | --help ]\n");
+ g_deinit();
g_exit(1);
}
@@ -226,6 +230,7 @@ main(int argc, char** argv)
g_printf("if it's not running, try removing ");
g_printf(pid_file);
g_printf("\n");
+ g_deinit();
g_exit(1);
}
@@ -234,12 +239,14 @@ main(int argc, char** argv)
if (0 == g_cfg)
{
g_printf("error creating config: quitting.\n");
+ g_deinit();
g_exit(1);
}
g_cfg->log.fd = -1; /* don't use logging before reading its config */
if (0 != config_read(g_cfg))
{
g_printf("error reading config: %s\nquitting.\n", g_get_strerror());
+ g_deinit();
g_exit(1);
}
@@ -257,6 +264,7 @@ main(int argc, char** argv)
g_printf("error opening log file [%s]. quitting.\n", g_cfg->log.log_file);
break;
}
+ g_deinit();
g_exit(1);
}
@@ -270,6 +278,7 @@ main(int argc, char** argv)
if (0 != g_pid)
{
+ g_deinit();
g_exit(0);
}
@@ -312,6 +321,7 @@ main(int argc, char** argv)
"error opening pid file[%s]: %s",
pid_file, g_get_strerror());
log_end(&(g_cfg->log));
+ g_deinit();
g_exit(1);
}
g_sprintf(pid_s, "%d", g_pid);