-typo
[oweals/gnunet.git] / src / util / crypto_rsa.c
index 8843464a2fa50b308defcdb6012a4cb7e0a68b45..0fb01678fe85b12ac53f3fbdb213b71f6fb1644a 100644 (file)
@@ -940,8 +940,6 @@ check_key_generation_completion (void *cls,
                                 const struct GNUNET_SCHEDULER_TaskContext *tc)
 {
   struct GNUNET_CRYPTO_RsaKeyGenerationContext *gc = cls;
-  enum GNUNET_OS_ProcessStatusType type;
-  unsigned long code;
   struct GNUNET_CRYPTO_RsaPrivateKey *pk;
 
   gc->read_task = GNUNET_SCHEDULER_NO_TASK;
@@ -951,24 +949,10 @@ check_key_generation_completion (void *cls,
     GNUNET_CRYPTO_rsa_key_create_stop (gc);
     return;
   }
-  if (GNUNET_OK != 
-      GNUNET_OS_process_status (gc->gnunet_rsa,
-                               &type, &code))
-  {
-    GNUNET_break (0);
-    gc->cont (gc->cont_cls, NULL, _("internal error"));
-    GNUNET_CRYPTO_rsa_key_create_stop (gc);
-    return;
-  }
+  GNUNET_assert (GNUNET_OK == 
+                GNUNET_OS_process_wait (gc->gnunet_rsa));
   GNUNET_OS_process_destroy (gc->gnunet_rsa);
   gc->gnunet_rsa = NULL;
-  if ( (GNUNET_OS_PROCESS_EXITED != type) ||
-       (0 != code) )
-  {
-    gc->cont (gc->cont_cls, NULL, _("gnunet-rsa failed"));
-    GNUNET_CRYPTO_rsa_key_create_stop (gc);
-    return;
-  }
   if (NULL == (pk = try_read_key (gc->filename)))
   {
     GNUNET_break (0);
@@ -977,6 +961,7 @@ check_key_generation_completion (void *cls,
     return;
   }
   gc->cont (gc->cont_cls, pk, NULL);
+  GNUNET_DISK_pipe_close (gc->gnunet_rsa_out);
   GNUNET_free (gc->filename);
   GNUNET_free (gc);
 }