X-Git-Url: http://git.maemo.org/git/?p=browser-switch;a=blobdiff_plain;f=main.c;h=a366fe7524205e01a972506a683ba2b09a3ef7c9;hp=428d5bcb04b15d3d53d7f394f5eb3b0906d74124;hb=8dde3166d0a99a74fc16f6afa4f5106167a9bab3;hpb=42f0af690415fc59317203a187501c00c012c9d9 diff --git a/main.c b/main.c index 428d5bc..a366fe7 100644 --- a/main.c +++ b/main.c @@ -71,8 +71,7 @@ static void read_config(int signalnum) { len = strlen(homedir) + strlen(CONFIGFILE_LOC) + 1; if (!(configfile = calloc(len, sizeof(char)))) goto out_noopen; - strncpy(configfile, homedir, strlen(homedir)); - strncat(configfile, CONFIGFILE_LOC, strlen(CONFIGFILE_LOC)); + snprintf(configfile, len, "%s%s", homedir, CONFIGFILE_LOC); if (!(fp = fopen(configfile, "r"))) goto out_noopen; @@ -101,7 +100,6 @@ static void read_config(int signalnum) { /* Read in the config file one line at a time and parse it XXX doesn't deal with lines longer than MAXLINE */ while (fgets(buf, MAXLINE, fp)) { - printf("%s", buf); /* skip blank lines and comments */ if (!regexec(&re_ignore, buf, 0, NULL, 0)) continue; @@ -162,7 +160,7 @@ out_noopen: } int main() { - OssoBrowser *obj; + OssoBrowser *obj_osso_browser, *obj_osso_browser_req; GMainLoop *mainloop; GError *error = NULL; @@ -171,6 +169,7 @@ int main() { if (ctx.continuous_mode) { struct sigaction act; act.sa_flags = SA_RESTART; + act.sa_mask = 0; act.sa_handler = waitforzombies; if (sigaction(SIGCHLD, &act, NULL) == -1) { @@ -205,11 +204,13 @@ int main() { dbus_request_osso_browser_name(&ctx); - obj = g_object_new(OSSO_BROWSER_TYPE, NULL); + obj_osso_browser = g_object_new(OSSO_BROWSER_TYPE, NULL); + obj_osso_browser_req = g_object_new(OSSO_BROWSER_TYPE, NULL); dbus_g_connection_register_g_object(ctx.session_bus, - "/com/nokia/osso_browser", G_OBJECT(obj)); + "/com/nokia/osso_browser", G_OBJECT(obj_osso_browser)); dbus_g_connection_register_g_object(ctx.session_bus, - "/com/nokia/osso_browser/request", G_OBJECT(obj)); + "/com/nokia/osso_browser/request", + G_OBJECT(obj_osso_browser_req)); mainloop = g_main_loop_new(NULL, FALSE); printf("Starting main loop\n");