summaryrefslogtreecommitdiffstats
path: root/bus
diff options
context:
space:
mode:
authorPeng Huang <phuang@phuang.nay.redhat.com>2009-02-12 13:25:01 +0800
committerPeng Huang <phuang@phuang.nay.redhat.com>2009-02-12 13:25:01 +0800
commit0bc9cf6403282a4c10e9331e67be92072cf5c5c2 (patch)
treee51f43fc35332f257cda47ad06e676dc82dc0e8b /bus
parent5ae50478381f53431a04e662a78d9e9db91a540e (diff)
downloadibus-0bc9cf6403282a4c10e9331e67be92072cf5c5c2.tar.gz
ibus-0bc9cf6403282a4c10e9331e67be92072cf5c5c2.tar.xz
ibus-0bc9cf6403282a4c10e9331e67be92072cf5c5c2.zip
Fix restart problem
Diffstat (limited to 'bus')
-rw-r--r--bus/ibusimpl.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/bus/ibusimpl.c b/bus/ibusimpl.c
index 216de11..3af090d 100644
--- a/bus/ibusimpl.c
+++ b/bus/ibusimpl.c
@@ -901,7 +901,14 @@ _ibus_exit (BusIBusImpl *ibus,
}
else {
extern gchar **g_argv;
- execv (g_argv[0], g_argv);
+ gchar *exe;
+
+ exe = g_strdup_printf ("/proc/%d/exe", getpid ());
+ if (!g_file_test (exe, G_FILE_TEST_EXISTS)) {
+ g_free (exe);
+ exe = g_argv[0];
+ }
+ execv (exe, g_argv);
g_warning ("execv %s failed!", g_argv[0]);
exit (-1);
}