style improvments wrt Mantis 1614 patch
[oweals/gnunet.git] / src / datastore / test_datastore_api_management.c
index 8e49409b6e2d8dff65fd7604fd7859fbd45c833d..81450d12ad092a4eacdf2faa689d58ab3782df90 100644 (file)
@@ -91,7 +91,7 @@ get_expiration (int i)
 {
   struct GNUNET_TIME_Absolute av;
 
-  av.value = now.value + i * 1000;
+  av.abs_value = now.abs_value + i * 1000;
   return av;
 }
 
@@ -183,7 +183,7 @@ check_value (void *cls,
   GNUNET_assert (type == get_type (i));
   GNUNET_assert (priority == get_priority (i));
   GNUNET_assert (anonymity == get_anonymity(i));
-  GNUNET_assert (expiration.value == get_expiration(i).value);
+  GNUNET_assert (expiration.abs_value == get_expiration(i).abs_value);
   GNUNET_DATASTORE_get_next (datastore, GNUNET_YES);
 }
 
@@ -350,7 +350,7 @@ run (void *cls,
 static int
 check ()
 {
-  pid_t pid;
+  struct GNUNET_OS_Process *proc;
   char cfg_name[128];
   char *const argv[] = { 
     "test-datastore-api-management",
@@ -368,7 +368,7 @@ check ()
                   sizeof (cfg_name),
                   "test_datastore_api_data_%s.conf",
                   plugin_name);
-  pid = GNUNET_OS_start_process (NULL, NULL, "gnunet-service-arm",
+  proc = GNUNET_OS_start_process (NULL, NULL, "gnunet-service-arm",
                                  "gnunet-service-arm",
 #if VERBOSE
                                  "-L", "DEBUG",
@@ -377,12 +377,14 @@ check ()
   GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1,
                       argv, "test-datastore-api", "nohelp",
                       options, &run, NULL);
-  if (0 != PLIBC_KILL (pid, SIGTERM))
+  if (0 != GNUNET_OS_process_kill (proc, SIGTERM))
     {
       GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill");
       ok = 1;
     }
-  GNUNET_OS_process_wait(pid);
+  GNUNET_OS_process_wait (proc);
+  GNUNET_OS_process_close (proc);
+  proc = NULL;
   if (ok != 0)
     fprintf (stderr, "Missed some testcases: %u\n", ok);
   return ok;