diff options
author | Christian Grothoff <christian@grothoff.org> | 2010-11-03 21:26:40 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2010-11-03 21:26:40 +0000 |
commit | 721e49caeea6ba5073f8bc5c6c08359295c02bb5 (patch) | |
tree | e06e80ba90af91e9452a48a7a5782913199b4877 /src/util/test_resolver_api.c | |
parent | 37ac1b7c9e9e05f93d4100cfb53450ec2d370989 (diff) | |
download | gnunet-721e49caeea6ba5073f8bc5c6c08359295c02bb5.tar.gz gnunet-721e49caeea6ba5073f8bc5c6c08359295c02bb5.zip |
original patch from Mantis 1614
Diffstat (limited to 'src/util/test_resolver_api.c')
-rw-r--r-- | src/util/test_resolver_api.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/util/test_resolver_api.c b/src/util/test_resolver_api.c index 2c3f95367..7321ed587 100644 --- a/src/util/test_resolver_api.c +++ b/src/util/test_resolver_api.c | |||
@@ -360,7 +360,7 @@ check() | |||
360 | int ok = 1 + 2 + 4 + 8; | 360 | int ok = 1 + 2 + 4 + 8; |
361 | char *fn; | 361 | char *fn; |
362 | char *pfx; | 362 | char *pfx; |
363 | pid_t pid; | 363 | GNUNET_OS_Process *proc; |
364 | char * const argv[] = | 364 | char * const argv[] = |
365 | { "test-resolver-api", "-c", "test_resolver_api_data.conf", | 365 | { "test-resolver-api", "-c", "test_resolver_api_data.conf", |
366 | #if VERBOSE | 366 | #if VERBOSE |
@@ -372,7 +372,7 @@ check() | |||
372 | pfx = GNUNET_OS_installation_get_path(GNUNET_OS_IPK_BINDIR); | 372 | pfx = GNUNET_OS_installation_get_path(GNUNET_OS_IPK_BINDIR); |
373 | GNUNET_asprintf(&fn, "%s%cgnunet-service-resolver", pfx, DIR_SEPARATOR); | 373 | GNUNET_asprintf(&fn, "%s%cgnunet-service-resolver", pfx, DIR_SEPARATOR); |
374 | GNUNET_free(pfx); | 374 | GNUNET_free(pfx); |
375 | pid = GNUNET_OS_start_process(NULL, NULL, fn, "gnunet-service-resolver", | 375 | proc = GNUNET_OS_start_process(NULL, NULL, fn, "gnunet-service-resolver", |
376 | #if VERBOSE | 376 | #if VERBOSE |
377 | "-L", "DEBUG", | 377 | "-L", "DEBUG", |
378 | #endif | 378 | #endif |
@@ -380,12 +380,14 @@ check() | |||
380 | GNUNET_free(fn); | 380 | GNUNET_free(fn); |
381 | GNUNET_assert(GNUNET_OK == GNUNET_PROGRAM_run((sizeof(argv) / sizeof(char *)) | 381 | GNUNET_assert(GNUNET_OK == GNUNET_PROGRAM_run((sizeof(argv) / sizeof(char *)) |
382 | - 1, argv, "test-resolver-api", "nohelp", options, &run, &ok)); | 382 | - 1, argv, "test-resolver-api", "nohelp", options, &run, &ok)); |
383 | if (0 != PLIBC_KILL(pid, SIGTERM)) | 383 | if (0 != GNUNET_OS_process_kill (proc, SIGTERM)) |
384 | { | 384 | { |
385 | GNUNET_log_strerror(GNUNET_ERROR_TYPE_WARNING, "kill"); | 385 | GNUNET_log_strerror(GNUNET_ERROR_TYPE_WARNING, "kill"); |
386 | ok = 1; | 386 | ok = 1; |
387 | } | 387 | } |
388 | GNUNET_OS_process_wait(pid); | 388 | GNUNET_OS_process_wait (proc); |
389 | GNUNET_OS_process_close (proc); | ||
390 | proc = NULL; | ||
389 | if (ok != 0) | 391 | if (ok != 0) |
390 | fprintf(stderr, "Missed some resolutions: %u\n", ok); | 392 | fprintf(stderr, "Missed some resolutions: %u\n", ok); |
391 | return ok; | 393 | return ok; |