aboutsummaryrefslogtreecommitdiff
path: root/src/util/os_installation.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/util/os_installation.c')
-rw-r--r--src/util/os_installation.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/util/os_installation.c b/src/util/os_installation.c
index 98ac7b989..8649fac6f 100644
--- a/src/util/os_installation.c
+++ b/src/util/os_installation.c
@@ -43,6 +43,7 @@
43 43
44#define LOG_STRERROR_FILE(kind,syscall,filename) GNUNET_log_from_strerror_file (kind, "util", syscall, filename) 44#define LOG_STRERROR_FILE(kind,syscall,filename) GNUNET_log_from_strerror_file (kind, "util", syscall, filename)
45 45
46
46#if LINUX 47#if LINUX
47/** 48/**
48 * Try to determine path by reading /proc/PID/exe 49 * Try to determine path by reading /proc/PID/exe
@@ -115,12 +116,13 @@ get_path_from_proc_exe ()
115} 116}
116#endif 117#endif
117 118
118#if WINDOWS
119 119
120#if WINDOWS
120static HINSTANCE dll_instance; 121static HINSTANCE dll_instance;
121 122
122 123
123/* GNUNET_util_cl_init() in common_logging.c is preferred. 124/**
125 * GNUNET_util_cl_init() in common_logging.c is preferred.
124 * This function is only for thread-local storage (not used in GNUnet) 126 * This function is only for thread-local storage (not used in GNUnet)
125 * and hInstance saving. 127 * and hInstance saving.
126 */ 128 */
@@ -226,6 +228,7 @@ get_path_from_module_filename ()
226} 228}
227#endif 229#endif
228 230
231
229#if DARWIN 232#if DARWIN
230/** 233/**
231 * Signature of the '_NSGetExecutablePath" function. 234 * Signature of the '_NSGetExecutablePath" function.
@@ -415,8 +418,7 @@ os_get_gnunet_path ()
415 return ret; 418 return ret;
416 /* other attempts here */ 419 /* other attempts here */
417 LOG (GNUNET_ERROR_TYPE_ERROR, 420 LOG (GNUNET_ERROR_TYPE_ERROR,
418 _ 421 _("Could not determine installation path for %s. Set `%s' environment variable.\n"),
419 ("Could not determine installation path for %s. Set `%s' environment variable.\n"),
420 "GNUnet", "GNUNET_PREFIX"); 422 "GNUnet", "GNUNET_PREFIX");
421 return NULL; 423 return NULL;
422} 424}
@@ -452,7 +454,7 @@ os_get_exec_path ()
452 454
453/** 455/**
454 * @brief get the path to a specific GNUnet installation directory or, 456 * @brief get the path to a specific GNUnet installation directory or,
455 * with GNUNET_IPK_SELF_PREFIX, the current running apps installation directory 457 * with #GNUNET_IPK_SELF_PREFIX, the current running apps installation directory
456 * @author Milan 458 * @author Milan
457 * @return a pointer to the dir path (to be freed by the caller) 459 * @return a pointer to the dir path (to be freed by the caller)
458 */ 460 */
@@ -657,9 +659,9 @@ GNUNET_OS_get_libexec_binary_path (const char *progname)
657 * binary with the -d flag. -d omits a programs main loop and only 659 * binary with the -d flag. -d omits a programs main loop and only
658 * executes all privileged operations in an binary. 660 * executes all privileged operations in an binary.
659 * @param params parameters used for w32 privilege checking (can be NULL for != w32 ) 661 * @param params parameters used for w32 privilege checking (can be NULL for != w32 )
660 * @return GNUNET_YES if the file is SUID (*nix) or can be executed with current privileges (W32), 662 * @return #GNUNET_YES if the file is SUID (*nix) or can be executed with current privileges (W32),
661 * GNUNET_NO if not SUID (but binary exists), 663 * #GNUNET_NO if not SUID (but binary exists),
662 * GNUNET_SYSERR on error (no such binary or not executable) 664 * #GNUNET_SYSERR on error (no such binary or not executable)
663 */ 665 */
664int 666int
665GNUNET_OS_check_helper_binary (const char *binary, int check_suid, const char *params) 667GNUNET_OS_check_helper_binary (const char *binary, int check_suid, const char *params)
@@ -704,7 +706,8 @@ GNUNET_OS_check_helper_binary (const char *binary, int check_suid, const char *p
704#endif 706#endif
705 if (NULL == p) 707 if (NULL == p)
706 { 708 {
707 LOG (GNUNET_ERROR_TYPE_INFO, _("Could not find binary `%s' in PATH!\n"), 709 LOG (GNUNET_ERROR_TYPE_INFO,
710 _("Could not find binary `%s' in PATH!\n"),
708 binary); 711 binary);
709 return GNUNET_SYSERR; 712 return GNUNET_SYSERR;
710 } 713 }