From 006131f6289cd0e03a470c77795ad50a4bf9e269 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Wed, 27 Oct 2021 12:55:03 +0200 Subject: [PATCH] common: Support MYPROC_SELF_EXE for Solaris * common/homedir.c (MYPROC_SELF_EXE): Add case for SunOS. -- GnuPG-bug-id: 5671 --- common/homedir.c | 2 ++ common/init.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/common/homedir.c b/common/homedir.c index df87e3891..70507b533 100644 --- a/common/homedir.c +++ b/common/homedir.c @@ -70,6 +70,8 @@ # define MYPROC_SELF_EXE "/proc/self/exe" #elif defined(__NetBSD__) # define MYPROC_SELF_EXE "/proc/curproc/exe" +#elif defined(__illumos__) || defined(__sun) +# define MYPROC_SELF_EXE "/proc/self/path/a.out" #else /* Assume other BSDs */ # define MYPROC_SELF_EXE "/proc/curproc/file" #endif diff --git a/common/init.c b/common/init.c index d44fb6ee3..4ae7cbcd3 100644 --- a/common/init.c +++ b/common/init.c @@ -210,7 +210,7 @@ _init_common_subsystems (gpg_err_source_t errsource, int *argcp, char ***argvp) { /* Don't show the error if the program does not have a console. * This is for example the case for daemons. */ - in rc = GetLastError (); + int rc = GetLastError (); if (rc != ERROR_INVALID_HANDLE) { log_info ("SetConsoleCP failed: %s\n", w32_strerror (rc));