mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-23 15:07:03 +01:00
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
This commit is contained in:
parent
947fedf0e7
commit
bcd8f0239d
@ -68,7 +68,9 @@
|
|||||||
* text was read. */
|
* text was read. */
|
||||||
#if __linux__
|
#if __linux__
|
||||||
# define MYPROC_SELF_EXE "/proc/self/exe"
|
# 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"
|
# define MYPROC_SELF_EXE "/proc/curproc/file"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -482,13 +484,13 @@ unix_rootdir (int want_sysconfdir)
|
|||||||
if (nread < 0)
|
if (nread < 0)
|
||||||
{
|
{
|
||||||
err = gpg_error_from_syserror ();
|
err = gpg_error_from_syserror ();
|
||||||
log_info ("error reading symlink '%s': %s\n",
|
|
||||||
MYPROC_SELF_EXE, gpg_strerror (err));
|
|
||||||
buffer[0] = 0;
|
buffer[0] = 0;
|
||||||
if ((name = getenv ("GNUPG_BUILD_ROOT")) && *name == '/')
|
if ((name = getenv ("GNUPG_BUILD_ROOT")) && *name == '/')
|
||||||
{
|
{
|
||||||
/* Try a fallback for systems w/o a supported /proc
|
/* 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);
|
xfree (buffer);
|
||||||
buffer = xstrconcat (name, "/bin/gpgconf", NULL);
|
buffer = xstrconcat (name, "/bin/gpgconf", NULL);
|
||||||
log_info ("trying fallback '%s'\n", buffer);
|
log_info ("trying fallback '%s'\n", buffer);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user