gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r29131 - gnunet/src/util


From: gnunet
Subject: [GNUnet-SVN] r29131 - gnunet/src/util
Date: Mon, 9 Sep 2013 15:07:05 +0200

Author: grothoff
Date: 2013-09-09 15:07:05 +0200 (Mon, 09 Sep 2013)
New Revision: 29131

Modified:
   gnunet/src/util/crypto_aes.c
   gnunet/src/util/crypto_ecc.c
   gnunet/src/util/os_priority.c
   gnunet/src/util/service.c
Log:
-eliminate LISTEN_PID check, silly idea anyway, better to just unset the 
LISTEN_FDS after use; also this is needed to make things work with 
gdb/valgrind/monkey/etc.

Modified: gnunet/src/util/crypto_aes.c
===================================================================
--- gnunet/src/util/crypto_aes.c        2013-09-09 12:39:37 UTC (rev 29130)
+++ gnunet/src/util/crypto_aes.c        2013-09-09 13:07:05 UTC (rev 29131)
@@ -51,7 +51,7 @@
  * @param handle handle to initialize
  * @param sessionkey session key to use
  * @param iv initialization vector to use
- * @return GNUNET_OK on success, GNUNET_SYSERR on error
+ * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
  */
 static int
 setup_cipher (gcry_cipher_hd_t *handle,

Modified: gnunet/src/util/crypto_ecc.c
===================================================================
--- gnunet/src/util/crypto_ecc.c        2013-09-09 12:39:37 UTC (rev 29130)
+++ gnunet/src/util/crypto_ecc.c        2013-09-09 13:07:05 UTC (rev 29131)
@@ -309,7 +309,7 @@
  * @param enc encoded public key
  * @param enclen number of bytes in enc (without 0-terminator)
  * @param pub where to store the public key
- * @return GNUNET_OK on success
+ * @return #GNUNET_OK on success
  */
 int
 GNUNET_CRYPTO_ecc_public_key_from_string (const char *enc, 
@@ -879,7 +879,6 @@
   }
   gcry_mpi_point_release (result);
   gcry_ctx_release (ctx);
-  /* FIXME: only use 'result_x' as key material */
 
   mpi_print (xbuf, sizeof (xbuf), result_x);
   GNUNET_CRYPTO_hash (xbuf, sizeof (xbuf), key_material);

Modified: gnunet/src/util/os_priority.c
===================================================================
--- gnunet/src/util/os_priority.c       2013-09-09 12:39:37 UTC (rev 29130)
+++ gnunet/src/util/os_priority.c       2013-09-09 13:07:05 UTC (rev 29131)
@@ -510,7 +510,6 @@
 {
 #ifndef MINGW
   pid_t ret;
-  char lpid[16];
   char fds[16];
   struct GNUNET_OS_Process *gnunet_proc;
   struct GNUNET_DISK_FileHandle *childpipe_read;
@@ -615,7 +614,7 @@
   if (0 != ret)
   {
     unsetenv (GNUNET_OS_CONTROL_PIPE);
-    gnunet_proc = GNUNET_malloc (sizeof (struct GNUNET_OS_Process));
+    gnunet_proc = GNUNET_new (struct GNUNET_OS_Process);
     gnunet_proc->pid = ret;
     gnunet_proc->control_pipe = childpipe_write;
     if (GNUNET_YES == pipe_control)
@@ -669,8 +668,6 @@
   if (NULL != lscp)
   {
     /* read systemd documentation... */
-    GNUNET_snprintf (lpid, sizeof (lpid), "%u", getpid ());
-    setenv ("LISTEN_PID", lpid, 1);
     i = 0;
     tgt = 3;
     while (-1 != lscp[i])

Modified: gnunet/src/util/service.c
===================================================================
--- gnunet/src/util/service.c   2013-09-09 12:39:37 UTC (rev 29130)
+++ gnunet/src/util/service.c   2013-09-09 13:07:05 UTC (rev 29131)
@@ -1301,8 +1301,6 @@
   int tolerant;
 
 #ifndef MINGW
-  const char *lpid;
-  unsigned int pid;
   const char *nfds;
   unsigned int cnt;
   int flags;
@@ -1343,9 +1341,7 @@
 
 #ifndef MINGW
   errno = 0;
-  if ((NULL != (lpid = getenv ("LISTEN_PID"))) &&
-      (1 == SSCANF (lpid, "%u", &pid)) && (getpid () == (pid_t) pid) &&
-      (NULL != (nfds = getenv ("LISTEN_FDS"))) &&
+  if ((NULL != (nfds = getenv ("LISTEN_FDS"))) &&
       (1 == SSCANF (nfds, "%u", &cnt)) && (cnt > 0) && (cnt < FD_SETSIZE) &&
       (cnt + 4 < FD_SETSIZE))
   {
@@ -1370,7 +1366,6 @@
         break;
       }
     }
-    unsetenv ("LISTEN_PID");
     unsetenv ("LISTEN_FDS");
   }
 #else




reply via email to

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