aboutsummaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2021-10-20 14:39:23 +0000
committerWerner Koch <[email protected]>2021-10-20 14:40:14 +0000
commit4cb44914b57a8db9d2f0d24e11d2b5e6fedc0a87 (patch)
treeb4c65e34c22c6a70019a0a5ca66b9ee5e6516541 /common
parentcommon,w32: Do not always print "Garbled console data" warning. (diff)
downloadgnupg-4cb44914b57a8db9d2f0d24e11d2b5e6fedc0a87.tar.gz
gnupg-4cb44914b57a8db9d2f0d24e11d2b5e6fedc0a87.zip
common: Silence warning from unix_rootdir on systems w/o /proc
* common/homedir.c (unix_rootdir): Silence diagnostic in the common case. (MYPROC_SELF_EXE): Support NetBSD. -- GnuPG-bug-id: 5656
Diffstat (limited to 'common')
-rw-r--r--common/homedir.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/common/homedir.c b/common/homedir.c
index 455c188c9..2877101e3 100644
--- a/common/homedir.c
+++ b/common/homedir.c
@@ -68,7 +68,9 @@
* text was read. */
#if __linux__
# define MYPROC_SELF_EXE "/proc/self/exe"
-#else /* Assume *BSD*/
+#elif defined(__NetBSD__)
+# define MYPROC_SELF_EXE "/proc/curproc/exe"
+#else /* Assume other BSDs */
# define MYPROC_SELF_EXE "/proc/curproc/file"
#endif
@@ -495,13 +497,13 @@ unix_rootdir (int want_sysconfdir)
if (nread < 0)
{
err = gpg_error_from_syserror ();
- log_info ("error reading symlink '%s': %s\n",
- MYPROC_SELF_EXE, gpg_strerror (err));
buffer[0] = 0;
if ((name = getenv ("GNUPG_BUILD_ROOT")) && *name == '/')
{
/* Try a fallback for systems w/o a supported /proc
- * file system. */
+ * file system if we are running a regression test. */
+ log_info ("error reading symlink '%s': %s\n",
+ MYPROC_SELF_EXE, gpg_strerror (err));
xfree (buffer);
buffer = xstrconcat (name, "/bin/gpgconf", NULL);
log_info ("trying fallback '%s'\n", buffer);