summaryrefslogtreecommitdiff
path: root/src/rygel/rygel-main.vala
diff options
context:
space:
mode:
authorZeeshan Ali (Khattak) <zeeshanak@gnome.org>2010-01-24 03:49:36 +0200
committerZeeshan Ali (Khattak) <zeeshanak@gnome.org>2010-01-24 03:49:36 +0200
commit256eeeeeca678ac975b40e626cbded86573c5364 (patch)
tree0f33a0b82216a1764ab9f0fdeff735df81b49a34 /src/rygel/rygel-main.vala
parentfe8cb01fae3f2f14d159ff343fc343f4d9795fd4 (diff)
downloadrygel-256eeeeeca678ac975b40e626cbded86573c5364.tar.gz
core: Restart application on SIGHUP
Diffstat (limited to 'src/rygel/rygel-main.vala')
-rw-r--r--src/rygel/rygel-main.vala12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/rygel/rygel-main.vala b/src/rygel/rygel-main.vala
index 855cc360..2f4d5ca1 100644
--- a/src/rygel/rygel-main.vala
+++ b/src/rygel/rygel-main.vala
@@ -37,6 +37,7 @@ public class Rygel.Main : Object {
private MainLoop main_loop;
private int exit_code;
+ public bool restart;
private Main () throws GLib.Error {
Environment.set_application_name (_(BuildConfig.PACKAGE_NAME));
@@ -58,6 +59,7 @@ public class Rygel.Main : Object {
public void exit (int exit_code) {
this.exit_code = exit_code;
+
this.main_loop.quit ();
}
@@ -69,7 +71,9 @@ public class Rygel.Main : Object {
return this.exit_code;
}
- private void application_exit_cb () {
+ private void application_exit_cb (bool restart) {
+ this.restart = restart;
+
this.exit (0);
}
@@ -188,6 +192,8 @@ public class Rygel.Main : Object {
Main main;
DBusService service;
+ var original_args = args;
+
try {
// Parse commandline options
CmdlineConfig.parse_args (ref args);
@@ -210,6 +216,10 @@ public class Rygel.Main : Object {
int exit_code = main.run ();
+ if (main.restart) {
+ Utils.restart_application (original_args);
+ }
+
return exit_code;
}
}