From b457229dd6ff2f6bdcfed158937df2c54862f41e Mon Sep 17 00:00:00 2001 From: Steven Luo Date: Fri, 11 Dec 2009 02:28:27 -0800 Subject: [PATCH] Don't exit if pidof dies abnormally There's no need to quit if pidof is killed or otherwise dies abnormally instead of exiting normally, we just can't check its exit status. --- launcher.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/launcher.c b/launcher.c index 5a6b951..d9fa584 100644 --- a/launcher.c +++ b/launcher.c @@ -46,9 +46,7 @@ static void launch_tear(struct swb_context *ctx, char *uri) { printf("launch_tear with uri '%s'\n", uri); status = system("pidof tear > /dev/null"); - if (!WIFEXITED(status)) - exit(1); - if (!WEXITSTATUS(status)) { + if (WIFEXITED(status) && !WEXITSTATUS(status)) { if (!tear_proxy) tear_proxy = dbus_g_proxy_new_for_name(ctx->session_bus, "com.nokia.tear", "/com/nokia/tear", @@ -80,9 +78,7 @@ void launch_microb(struct swb_context *ctx, char *uri) { uri = "new_window"; status = system("pidof /usr/sbin/browserd > /dev/null"); - if (!WIFEXITED(status)) - exit(1); - if (WEXITSTATUS(status)) { + if (WIFEXITED(status) && WEXITSTATUS(status)) { kill_browserd = 1; system("/usr/sbin/browserd -d"); } -- 1.7.9.5