[maemo-commits] [maemo-commits] r15422 - in projects/haf/trunk/maemo-launcher: . client debian launcher

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Wed Apr 16 01:35:48 EEST 2008
Author: guillem
Date: 2008-04-16 01:35:47 +0300 (Wed, 16 Apr 2008)
New Revision: 15422

Modified:
   projects/haf/trunk/maemo-launcher/ChangeLog
   projects/haf/trunk/maemo-launcher/client/client.c
   projects/haf/trunk/maemo-launcher/debian/changelog
   projects/haf/trunk/maemo-launcher/launcher/launcher.c
   projects/haf/trunk/maemo-launcher/launcher/summoner.c
Log:
Use exit(3) instead of _exit(2) so that things like atexit(3) work

(Fixes: NB#80273)


Modified: projects/haf/trunk/maemo-launcher/ChangeLog
===================================================================
--- projects/haf/trunk/maemo-launcher/ChangeLog	2008-04-15 22:35:45 UTC (rev 15421)
+++ projects/haf/trunk/maemo-launcher/ChangeLog	2008-04-15 22:35:47 UTC (rev 15422)
@@ -1,5 +1,13 @@
 2008-03-07  Guillem Jover  <guillem.jover at nokia.com>
 
+	* client/client.c (cleanup): New function.
+	(main): Install cleanup as an atexit function.
+	* launcher/launcher.c (launch_process): Call exit instead of _exit.
+	* launcher/summoner.c (summon_process): Likewise.
+	(main): Return 0 at the end of the function instead of _exit.
+
+2008-03-07  Guillem Jover  <guillem.jover at nokia.com>
+
 	* configure.ac (CLIENT): Use only the minimum dependencies,
 	GTK_DEPENDS and hildon-1.
 

Modified: projects/haf/trunk/maemo-launcher/client/client.c
===================================================================
--- projects/haf/trunk/maemo-launcher/client/client.c	2008-04-15 22:35:45 UTC (rev 15421)
+++ projects/haf/trunk/maemo-launcher/client/client.c	2008-04-15 22:35:47 UTC (rev 15422)
@@ -1,7 +1,7 @@
 /*
  * $Id$
  *
- * Copyright (C) 2005, 2007 Nokia Corporation
+ * Copyright (C) 2005, 2007, 2008 Nokia Corporation
  *
  * Author: Guillem Jover <guillem.jover at nokia.com>
  *
@@ -24,12 +24,19 @@
 #include <hildon/hildon-program.h>
 #include <hildon/hildon-window.h>
 
+void
+cleanup(void)
+{
+  g_print("called at exit time...\n");
+}
+
 int
 main(int argc, char *argv[])
 {
   GTimer *timer;
   HildonProgram *program;
   HildonWindow *window;
+  int r;
 
   timer = g_timer_new();
 
@@ -53,6 +60,11 @@
 
   g_timer_destroy(timer);
 
+  g_print("installing exit function...\n");
+  r = atexit(cleanup);
+  if (r)
+    g_print("error while setting exit function (%d)\n", r);
+
   gtk_main();
 
   return 0;

Modified: projects/haf/trunk/maemo-launcher/debian/changelog
===================================================================
--- projects/haf/trunk/maemo-launcher/debian/changelog	2008-04-15 22:35:45 UTC (rev 15421)
+++ projects/haf/trunk/maemo-launcher/debian/changelog	2008-04-15 22:35:47 UTC (rev 15422)
@@ -3,6 +3,8 @@
   * New Upstream Release.
     - Port client to Hildon 1.x.
     - Use compile options determined from configure to build the client.
+    - Use exit(3) instead of _exit(2) so that things like atexit(3) work.
+      (Fixes: NB#80273)
   * Update copyright year in debian/copyright.
 
  -- Guillem Jover <guillem.jover at nokia.com>  Tue, 04 Dec 2007 20:03:29 +0200

Modified: projects/haf/trunk/maemo-launcher/launcher/launcher.c
===================================================================
--- projects/haf/trunk/maemo-launcher/launcher/launcher.c	2008-04-15 22:35:45 UTC (rev 15421)
+++ projects/haf/trunk/maemo-launcher/launcher/launcher.c	2008-04-15 22:35:47 UTC (rev 15422)
@@ -154,7 +154,7 @@
   report_set_output(report_none);
 #endif
 
-  _exit(prog->entry(prog->argc, prog->argv));
+  exit(prog->entry(prog->argc, prog->argv));
 }
 
 static int

Modified: projects/haf/trunk/maemo-launcher/launcher/summoner.c
===================================================================
--- projects/haf/trunk/maemo-launcher/launcher/summoner.c	2008-04-15 22:35:45 UTC (rev 15421)
+++ projects/haf/trunk/maemo-launcher/launcher/summoner.c	2008-04-15 22:35:47 UTC (rev 15422)
@@ -42,7 +42,7 @@
 
   debug("summoning process: '%s'\n", prog->filename);
 
-  _exit(prog->entry(prog->argc, prog->argv));
+  exit(prog->entry(prog->argc, prog->argv));
 }
 
 static void
@@ -132,6 +132,6 @@
   else
     error("nothing to summon\n");
 
-  _exit (0);
+  return 0;
 }
 


More information about the maemo-commits mailing list