projects
/
platform
/
upstream
/
ibus.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e502b41
)
Fix restart problem when the image file is removed.
author
Peng Huang
<shawn.p.huang@gmail.com>
Wed, 26 May 2010 04:20:29 +0000
(12:20 +0800)
committer
Peng Huang
<shawn.p.huang@gmail.com>
Wed, 26 May 2010 22:42:10 +0000
(06:42 +0800)
bus/ibusimpl.c
patch
|
blob
|
history
diff --git
a/bus/ibusimpl.c
b/bus/ibusimpl.c
index
56e6ad5
..
17054f4
100644
(file)
--- a/
bus/ibusimpl.c
+++ b/
bus/ibusimpl.c
@@
-1316,6
+1316,15
@@
_ibus_exit (BusIBusImpl *ibus,
}
execv (exe, g_argv);
+
+ /* If the server binary is replaced while the server is running,
+ * "readlink /proc/[pid]/exe" might return a path with " (deleted)"
+ * suffix. */
+ const gchar suffix[] = " (deleted)";
+ if (g_str_has_suffix (exe, suffix)) {
+ exe [strlen (exe) - strlen (suffix)] = '\0';
+ execv (exe, g_argv);
+ }
g_warning ("execv %s failed!", g_argv[0]);
exit (-1);
}