gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r15889 - in gnunet/src: include nat util


From: gnunet
Subject: [GNUnet-SVN] r15889 - in gnunet/src: include nat util
Date: Fri, 8 Jul 2011 12:58:56 +0200

Author: grothoff
Date: 2011-07-08 12:58:56 +0200 (Fri, 08 Jul 2011)
New Revision: 15889

Modified:
   gnunet/src/include/gnunet_os_lib.h
   gnunet/src/nat/nat_mini.c
   gnunet/src/nat/test_nat_mini.c
   gnunet/src/util/os_priority.c
Log:
apifix

Modified: gnunet/src/include/gnunet_os_lib.h
===================================================================
--- gnunet/src/include/gnunet_os_lib.h  2011-07-08 10:23:45 UTC (rev 15888)
+++ gnunet/src/include/gnunet_os_lib.h  2011-07-08 10:58:56 UTC (rev 15889)
@@ -288,14 +288,9 @@
  * Stop/kill a command.
  *
  * @param cmd handle to the process
- * @param type status type
- * @param code return code/signal number
- * @return GNUNET_OK on success, GNUNET_NO if we killed the process
  */
-int
-GNUNET_OS_command_stop (struct GNUNET_OS_CommandHandle *cmd,
-                       enum GNUNET_OS_ProcessStatusType *type, 
-                       unsigned long *code);
+void
+GNUNET_OS_command_stop (struct GNUNET_OS_CommandHandle *cmd);
 
 
 /**

Modified: gnunet/src/nat/nat_mini.c
===================================================================
--- gnunet/src/nat/nat_mini.c   2011-07-08 10:23:45 UTC (rev 15888)
+++ gnunet/src/nat/nat_mini.c   2011-07-08 10:58:56 UTC (rev 15889)
@@ -188,13 +188,10 @@
                        const char *line)
 {
   struct GNUNET_NAT_MiniHandle *mini = cls;
-  enum GNUNET_OS_ProcessStatusType type;
-  unsigned long code;
 
   if (NULL == line)
     {
-      GNUNET_OS_command_stop (mini->refresh_cmd,
-                             &type, &code);
+      GNUNET_OS_command_stop (mini->refresh_cmd);
       mini->refresh_cmd = NULL;
       mini->refresh_task = GNUNET_SCHEDULER_add_delayed (MAP_REFRESH_FREQ,
                                                         &do_refresh,
@@ -242,8 +239,6 @@
                    const char *line)
 {
   struct GNUNET_NAT_MiniHandle *mini = cls;
-  enum GNUNET_OS_ProcessStatusType type;
-  unsigned long code;
   const char *ipaddr;
   char *ipa;
   const char *pstr;
@@ -251,8 +246,7 @@
 
   if (NULL == line)
     {
-      GNUNET_OS_command_stop (mini->map_cmd,
-                             &type, &code);
+      GNUNET_OS_command_stop (mini->map_cmd);
       mini->map_cmd = NULL;
       if (mini->did_map == GNUNET_YES)
        mini->refresh_task = GNUNET_SCHEDULER_add_delayed (MAP_REFRESH_FREQ,
@@ -354,13 +348,10 @@
                      const char *line)
 {
   struct GNUNET_NAT_MiniHandle *mini = cls;
-  enum GNUNET_OS_ProcessStatusType type;
-  unsigned long code;
 
   if (NULL == line)
     {
-      GNUNET_OS_command_stop (mini->unmap_cmd,
-                             &type, &code);
+      GNUNET_OS_command_stop (mini->unmap_cmd);
       mini->unmap_cmd = NULL;
       GNUNET_free (mini);
       return;
@@ -381,15 +372,12 @@
 GNUNET_NAT_mini_map_stop (struct GNUNET_NAT_MiniHandle *mini)
 {
   char pstr[6];
-  enum GNUNET_OS_ProcessStatusType type;
-  unsigned long code;
 
   if (! mini->did_map)
     {
       if (mini->map_cmd != NULL)
        {
-         GNUNET_OS_command_stop (mini->map_cmd, 
-                                 &type, &code);
+         GNUNET_OS_command_stop (mini->map_cmd);
          mini->map_cmd = NULL;
        }
       GNUNET_free (mini);
@@ -402,8 +390,7 @@
     }
   if (mini->refresh_cmd != NULL)
     {
-      GNUNET_OS_command_stop (mini->refresh_cmd,
-                             &type, &code);
+      GNUNET_OS_command_stop (mini->refresh_cmd);
       mini->refresh_cmd = NULL;
     }
   mini->ac (mini->ac_cls, GNUNET_NO,

Modified: gnunet/src/nat/test_nat_mini.c
===================================================================
--- gnunet/src/nat/test_nat_mini.c      2011-07-08 10:23:45 UTC (rev 15888)
+++ gnunet/src/nat/test_nat_mini.c      2011-07-08 10:58:56 UTC (rev 15889)
@@ -38,14 +38,9 @@
 
 #define VERBOSE GNUNET_YES
 
-
 /* Time to wait before stopping NAT, in seconds */
-#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 60)
+#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 5)
 
-
-
-
-
 /**
  * Function called on each address that the NAT service
  * believes to be valid for the transport.

Modified: gnunet/src/util/os_priority.c
===================================================================
--- gnunet/src/util/os_priority.c       2011-07-08 10:23:45 UTC (rev 15888)
+++ gnunet/src/util/os_priority.c       2011-07-08 10:58:56 UTC (rev 15889)
@@ -1275,14 +1275,9 @@
  * from an independent task (not within the line processor).
  *
  * @param cmd handle to the process
- * @param type status type
- * @param code return code/signal number
- * @return GNUNET_OK on success, GNUNET_NO if we killed the process
  */
-int
-GNUNET_OS_command_stop (struct GNUNET_OS_CommandHandle *cmd,
-                       enum GNUNET_OS_ProcessStatusType *type, 
-                       unsigned long *code)
+void
+GNUNET_OS_command_stop (struct GNUNET_OS_CommandHandle *cmd)
 {
   int killed;
 
@@ -1293,14 +1288,10 @@
     }
   killed = GNUNET_OS_process_kill (cmd->eip, SIGKILL);
   GNUNET_break (GNUNET_OK ==
-               GNUNET_OS_process_status (cmd->eip,
-                                         type, code));
+               GNUNET_OS_process_wait (cmd->eip));
   GNUNET_OS_process_close (cmd->eip);
   GNUNET_DISK_pipe_close (cmd->opipe);
   GNUNET_free (cmd);
-  if (GNUNET_OK == killed)
-    return GNUNET_NO;
-  return GNUNET_OK;  
 }
 
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]