aboutsummaryrefslogtreecommitdiff
path: root/src/util/os_installation.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2012-06-14 05:26:09 +0000
committerChristian Grothoff <christian@grothoff.org>2012-06-14 05:26:09 +0000
commitcf6fd4b01da9049e69e5c644e7ef6012b29fab12 (patch)
treec9684d7eefafa42b18d6496c607c401e0b4b7558 /src/util/os_installation.c
parentf45b71222c4c3529122dc376425d1fd76bdcdc50 (diff)
downloadgnunet-cf6fd4b01da9049e69e5c644e7ef6012b29fab12.tar.gz
gnunet-cf6fd4b01da9049e69e5c644e7ef6012b29fab12.zip
-LRN: fix binary checker to use proper API
Diffstat (limited to 'src/util/os_installation.c')
-rw-r--r--src/util/os_installation.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/util/os_installation.c b/src/util/os_installation.c
index c44f741f4..ef3fb3777 100644
--- a/src/util/os_installation.c
+++ b/src/util/os_installation.c
@@ -33,6 +33,7 @@
33#include "gnunet_configuration_lib.h" 33#include "gnunet_configuration_lib.h"
34#include "gnunet_disk_lib.h" 34#include "gnunet_disk_lib.h"
35#include "gnunet_os_lib.h" 35#include "gnunet_os_lib.h"
36#include "gnunet_strings_lib.h"
36#if DARWIN 37#if DARWIN
37#include <mach-o/ldsyms.h> 38#include <mach-o/ldsyms.h>
38#include <mach-o/dyld.h> 39#include <mach-o/dyld.h>
@@ -443,7 +444,8 @@ GNUNET_OS_installation_get_path (enum GNUNET_OS_InstallationPathKind dirkind)
443 * Attempts to find the file using the current 444 * Attempts to find the file using the current
444 * PATH environment variable as a search path. 445 * PATH environment variable as a search path.
445 * 446 *
446 * @param binary the name of the file to check 447 * @param binary the name of the file to check.
448 * W32: must not have an .exe suffix.
447 * @return GNUNET_YES if the file is SUID, 449 * @return GNUNET_YES if the file is SUID,
448 * GNUNET_NO if not SUID (but binary exists) 450 * GNUNET_NO if not SUID (but binary exists)
449 * GNUNET_SYSERR on error (no such binary or not executable) 451 * GNUNET_SYSERR on error (no such binary or not executable)
@@ -459,8 +461,9 @@ GNUNET_OS_check_helper_binary (const char *binary)
459 char *binaryexe; 461 char *binaryexe;
460 462
461 GNUNET_asprintf (&binaryexe, "%s.exe", binary); 463 GNUNET_asprintf (&binaryexe, "%s.exe", binary);
462 if (DIR_SEPARATOR == binary[0]) 464 if (GNUNET_YES == GNUNET_STRINGS_path_is_absolute (binaryexe, GNUNET_NO,
463 p = GNUNET_strdup (binary); 465 NULL, NULL))
466 p = GNUNET_strdup (binaryexe);
464 else 467 else
465 { 468 {
466 p = get_path_from_PATH (binaryexe); 469 p = get_path_from_PATH (binaryexe);
@@ -473,7 +476,8 @@ GNUNET_OS_check_helper_binary (const char *binary)
473 } 476 }
474 GNUNET_free (binaryexe); 477 GNUNET_free (binaryexe);
475#else 478#else
476 if (DIR_SEPARATOR == binary[0]) 479 if (GNUNET_YES == GNUNET_STRINGS_path_is_absolute (binary, GNUNET_NO,
480 NULL, NULL))
477 p = GNUNET_strdup (binary); 481 p = GNUNET_strdup (binary);
478 else 482 else
479 { 483 {