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

From: www-data at stage.maemo.org www-data at stage.maemo.org
Date: Tue Nov 28 23:10:42 EET 2006
Author: guillem
Date: 2006-11-28 23:10:40 +0200 (Tue, 28 Nov 2006)
New Revision: 8427

Modified:
   projects/haf/trunk/maemo-launcher/ChangeLog
   projects/haf/trunk/maemo-launcher/debian/changelog
   projects/haf/trunk/maemo-launcher/launcher/booster.c
   projects/haf/trunk/maemo-launcher/launcher/invoker.c
   projects/haf/trunk/maemo-launcher/launcher/launcher.c
   projects/haf/trunk/maemo-launcher/launcher/summoner.c
Log:
	* launcher/launcher.c (clean_childs): Do not use asprintf, and print
	the strings directly instead.
	* launcher/summoner.c (main): Check for asprintf errors.
	* launcher/invoker.c (main): Likewise.
	* launcher/booster.c (booster_module_load): Likewise.


Modified: projects/haf/trunk/maemo-launcher/ChangeLog
===================================================================
--- projects/haf/trunk/maemo-launcher/ChangeLog	2006-11-28 20:59:17 UTC (rev 8426)
+++ projects/haf/trunk/maemo-launcher/ChangeLog	2006-11-28 21:10:40 UTC (rev 8427)
@@ -1,5 +1,13 @@
 2006-11-28  Guillem Jover  <guillem.jover at nokia.com>
 
+	* launcher/launcher.c (clean_childs): Do not use asprintf, and print
+	the strings directly instead.
+	* launcher/summoner.c (main): Check for asprintf errors.
+	* launcher/invoker.c (main): Likewise.
+	* launcher/booster.c (booster_module_load): Likewise.
+
+2006-11-28  Guillem Jover  <guillem.jover at nokia.com>
+
 	Unbranding (second part).
 
 	* launcher/comm_dbus.c (main): Replace explicit maemo-launcher string

Modified: projects/haf/trunk/maemo-launcher/debian/changelog
===================================================================
--- projects/haf/trunk/maemo-launcher/debian/changelog	2006-11-28 20:59:17 UTC (rev 8426)
+++ projects/haf/trunk/maemo-launcher/debian/changelog	2006-11-28 21:10:40 UTC (rev 8427)
@@ -3,6 +3,7 @@
   * New Upstream Release.
     - Link against libstdc++. (Fixes: NB#47726)
     - Initialize Xft by calling its constructors. (Fixes: NB#17937)
+    - Check for asprintf errors. (Fixes: NB#45396)
   * Fix chmod instance following upstream maemo-defender to defender rename.
 
  -- Guillem Jover <guillem.jover at nokia.com>  Mon, 20 Nov 2006 15:21:39 +0200

Modified: projects/haf/trunk/maemo-launcher/launcher/booster.c
===================================================================
--- projects/haf/trunk/maemo-launcher/launcher/booster.c	2006-11-28 20:59:17 UTC (rev 8426)
+++ projects/haf/trunk/maemo-launcher/launcher/booster.c	2006-11-28 21:10:40 UTC (rev 8427)
@@ -35,13 +35,14 @@
   char *booster_path;
   char *booster_sym;
   char *error_s;
+  int err;
 
-  asprintf(&booster_path, BOOSTER_DIR "/booster-%s.so", booster->name);
-  if (!booster_path)
+  err = asprintf(&booster_path, BOOSTER_DIR "/booster-%s.so", booster->name);
+  if (err)
     die(40, "allocating booster module path\n");
 
-  asprintf(&booster_sym, "booster_%s_api", booster->name);
-  if (!booster_sym)
+  err = asprintf(&booster_sym, "booster_%s_api", booster->name);
+  if (err)
     die(40, "allocating booster symbol path\n");
 
   /* Load the booster module. */

Modified: projects/haf/trunk/maemo-launcher/launcher/invoker.c
===================================================================
--- projects/haf/trunk/maemo-launcher/launcher/invoker.c	2006-11-28 20:59:17 UTC (rev 8426)
+++ projects/haf/trunk/maemo-launcher/launcher/invoker.c	2006-11-28 21:10:40 UTC (rev 8427)
@@ -358,7 +358,8 @@
   {
     /* Called with a different name. Add the proper extension and launch it.
      * Do not try to parse any arguments. */
-    asprintf(&launch, "%s.launch", argv[0]);
+    if (asprintf(&launch, "%s.launch", argv[0]) == -1)
+      die(1, "allocating program name buffer");
     prog_name = launch;
     prog_argc = argc;
     prog_argv = argv;

Modified: projects/haf/trunk/maemo-launcher/launcher/launcher.c
===================================================================
--- projects/haf/trunk/maemo-launcher/launcher/launcher.c	2006-11-28 20:59:17 UTC (rev 8426)
+++ projects/haf/trunk/maemo-launcher/launcher/launcher.c	2006-11-28 21:10:40 UTC (rev 8427)
@@ -518,7 +518,6 @@
 clean_childs(kindergarten_t *childs)
 {
   int status;
-  char *cause;
   pid_t childpid;
 
   while ((childpid = waitpid(-1, &status, WNOHANG)) > 0)
@@ -526,13 +525,13 @@
     release_child_slot(childs, childpid, status);
 
     if (WIFEXITED(status))
-      asprintf(&cause, "exit()=%d", WEXITSTATUS(status));
+      info("child (pid=%d) terminated due to exit()=%d\n", childpid,
+	   WEXITSTATUS(status));
     else if (WIFSIGNALED(status))
-      asprintf(&cause, "signal=%d", WTERMSIG(status));
-
-    info("child (pid=%d) exited due to %s\n", childpid, cause);
-
-    free(cause);
+      info("child (pid=%d) terminated due to signal=%d\n", childpid,
+	   WTERMSIG(status));
+    else
+      info("child (pid=%d) terminated due to unknown status=%d\n", status);
   }
 }
 

Modified: projects/haf/trunk/maemo-launcher/launcher/summoner.c
===================================================================
--- projects/haf/trunk/maemo-launcher/launcher/summoner.c	2006-11-28 20:59:17 UTC (rev 8426)
+++ projects/haf/trunk/maemo-launcher/launcher/summoner.c	2006-11-28 21:10:40 UTC (rev 8427)
@@ -104,7 +104,8 @@
 
     /* Called with a different name. Add the proper extension and launch it.
      * Do not try to parse any arguments. */
-    asprintf(&launch, "%s.launch", argv[0]);
+    if (asprintf(&launch, "%s.launch", argv[0]) == -1)
+      die(1, "allocating program name buffer");
     prog.filename = launch;
     prog.argc = argc;
     prog.argv = argv;


More information about the maemo-commits mailing list