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

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

Modified:
   projects/haf/trunk/maemo-launcher/ChangeLog
   projects/haf/trunk/maemo-launcher/launcher/invoker.c
   projects/haf/trunk/maemo-launcher/launcher/launcher.c
Log:
Use more descriptive names for the msg local variable


Modified: projects/haf/trunk/maemo-launcher/ChangeLog
===================================================================
--- projects/haf/trunk/maemo-launcher/ChangeLog	2008-04-15 22:35:36 UTC (rev 15416)
+++ projects/haf/trunk/maemo-launcher/ChangeLog	2008-04-15 22:35:38 UTC (rev 15417)
@@ -1,3 +1,14 @@
+2008-02-22  Guillem Jover  <guillem.jover at nokia.com>
+
+	* launcher/invoker.c (invoke_recv_ack): Use more descriptive names
+	for the msg variable.
+	(invoker_recv_pid): Likewise.
+	(invoker_recv_exit): Likewise.
+	* launcher/launcher.c (invoked_get_magic): Likewise.
+	(invoked_get_args): Likewise.
+	(invoked_get_prio): Likewise.
+	(invoked_get_actions): Likewise.
+
 2008-02-21  Guillem Jover  <guillem.jover at nokia.com>
 
 	* launcher/comm_msg.h (struct comm_msg): Move definition to ...

Modified: projects/haf/trunk/maemo-launcher/launcher/invoker.c
===================================================================
--- projects/haf/trunk/maemo-launcher/launcher/invoker.c	2008-04-15 22:35:36 UTC (rev 15416)
+++ projects/haf/trunk/maemo-launcher/launcher/invoker.c	2008-04-15 22:35:38 UTC (rev 15417)
@@ -1,7 +1,7 @@
 /*
  * $Id$
  *
- * Copyright (C) 2005, 2006, 2007 Nokia Corporation
+ * Copyright (C) 2005, 2006, 2007, 2008 Nokia Corporation
  *
  * Author: Guillem Jover <guillem.jover at nokia.com>
  *
@@ -89,13 +89,13 @@
 static bool
 invoke_recv_ack(int fd)
 {
-  uint32_t msg;
+  uint32_t action;
 
   /* Revceive ACK. */
-  invoke_recv_msg(fd, &msg);
+  invoke_recv_msg(fd, &action);
 
-  if (msg != INVOKER_MSG_ACK)
-    die(1, "receiving wrong ack (%08x)\n", msg);
+  if (action != INVOKER_MSG_ACK)
+    die(1, "receiving wrong ack (%08x)\n", action);
   else
     return true;
 }
@@ -193,17 +193,17 @@
 static bool
 invoker_recv_pid(int fd)
 {
-  uint32_t msg;
+  uint32_t action, pid;
 
   /* Receive action. */
-  invoke_recv_msg(fd, &msg);
+  invoke_recv_msg(fd, &action);
 
-  if (msg != INVOKER_MSG_PID)
-    die(1, "receiving bad pid (%08x)\n", msg);
+  if (action != INVOKER_MSG_PID)
+    die(1, "receiving bad pid (%08x)\n", action);
 
   /* Receive pid. */
-  invoke_recv_msg(fd, &msg);
-  invoked_pid = msg;
+  invoke_recv_msg(fd, &pid);
+  invoked_pid = pid;
 
   return true;
 }
@@ -211,18 +211,18 @@
 static int
 invoker_recv_exit(int fd)
 {
-  uint32_t msg;
+  uint32_t action, status;
 
   /* Receive action. */
-  invoke_recv_msg(fd, &msg);
+  invoke_recv_msg(fd, &action);
 
-  if (msg != INVOKER_MSG_EXIT)
-    die(1, "receiving bad exit status (%08x)\n", msg);
+  if (action != INVOKER_MSG_EXIT)
+    die(1, "receiving bad exit status (%08x)\n", action);
 
   /* Receive status. */
-  invoke_recv_msg(fd, &msg);
+  invoke_recv_msg(fd, &status);
 
-  return msg;
+  return status;
 }
 
 static uint32_t

Modified: projects/haf/trunk/maemo-launcher/launcher/launcher.c
===================================================================
--- projects/haf/trunk/maemo-launcher/launcher/launcher.c	2008-04-15 22:35:36 UTC (rev 15416)
+++ projects/haf/trunk/maemo-launcher/launcher/launcher.c	2008-04-15 22:35:38 UTC (rev 15417)
@@ -184,27 +184,27 @@
 static bool
 invoked_get_magic(int fd, prog_t *prog)
 {
-  uint32_t msg;
+  uint32_t magic;
 
   /* Receive the magic. */
-  invoke_recv_msg(fd, &msg);
-  if ((msg & INVOKER_MSG_MASK) == INVOKER_MSG_MAGIC)
+  invoke_recv_msg(fd, &magic);
+  if ((magic & INVOKER_MSG_MASK) == INVOKER_MSG_MAGIC)
   {
-    if ((msg & INVOKER_MSG_MAGIC_VERSION_MASK) == INVOKER_MSG_MAGIC_VERSION)
+    if ((magic & INVOKER_MSG_MAGIC_VERSION_MASK) == INVOKER_MSG_MAGIC_VERSION)
       invoke_send_msg(fd, INVOKER_MSG_ACK);
     else
     {
-      error("receiving bad magic version (%08x)\n", msg);
+      error("receiving bad magic version (%08x)\n", magic);
       return false;
     }
   }
   else
   {
-    error("receiving bad magic (%08x)\n", msg);
+    error("receiving bad magic (%08x)\n", magic);
     return false;
   }
 
-  prog->options = msg & INVOKER_MSG_MAGIC_OPTION_MASK;
+  prog->options = magic & INVOKER_MSG_MAGIC_OPTION_MASK;
 
   return true;
 }
@@ -247,14 +247,14 @@
 invoked_get_args(int fd, prog_t *prog)
 {
   int i;
-  uint32_t msg;
+  uint32_t argc;
   size_t size;
 
   /* Get argc. */
-  invoke_recv_msg(fd, &msg);
-  prog->argc = msg;
-  size = msg * sizeof(char *);
-  if (size < msg)
+  invoke_recv_msg(fd, &argc);
+  prog->argc = argc;
+  size = argc * sizeof(char *);
+  if (size < argc)
   {
     error("on buggy or malicious invoker code, heap overflow avoided\n");
     return false;
@@ -285,10 +285,10 @@
 static bool
 invoked_get_prio(int fd, prog_t *prog)
 {
-  uint32_t msg;
+  uint32_t prio;
 
-  invoke_recv_msg(fd, &msg);
-  prog->prio = msg;
+  invoke_recv_msg(fd, &prio);
+  prog->prio = prio;
 
   invoke_send_msg(fd, INVOKER_MSG_ACK);
 
@@ -315,12 +315,12 @@
 {
   while (1)
   {
-    uint32_t msg;
+    uint32_t action;
 
     /* Get the action. */
-    invoke_recv_msg(fd, &msg);
+    invoke_recv_msg(fd, &action);
 
-    switch (msg)
+    switch (action)
     {
     case INVOKER_MSG_EXEC:
       invoked_get_exec(fd, prog);
@@ -339,7 +339,7 @@
 
       return true;
     default:
-      error("receiving invalid action (%08x)\n", msg);
+      error("receiving invalid action (%08x)\n", action);
       return false;
     }
   }


More information about the maemo-commits mailing list