diff options
| author | saturneric <[email protected]> | 2024-07-29 00:58:22 +0000 | 
|---|---|---|
| committer | saturneric <[email protected]> | 2024-07-29 00:58:22 +0000 | 
| commit | 8cd4441a448bfa7a0140bd6ffaf5402caabc8277 (patch) | |
| tree | 96db4b91a3a2db5f9ea9045bd965d387d56d8c27 /src | |
| parent | feat: improve modules translation (diff) | |
| download | Modules-8cd4441a448bfa7a0140bd6ffaf5402caabc8277.tar.gz Modules-8cd4441a448bfa7a0140bd6ffaf5402caabc8277.zip | |
fix: solve build issues on windows
Diffstat (limited to '')
| -rw-r--r-- | src/m_pinentry/pinentry.cpp | 69 | ||||
| -rw-r--r-- | src/m_pinentry/pinentry.h | 2 | 
2 files changed, 6 insertions, 65 deletions
| diff --git a/src/m_pinentry/pinentry.cpp b/src/m_pinentry/pinentry.cpp index 072fa6c..c2965a8 100644 --- a/src/m_pinentry/pinentry.cpp +++ b/src/m_pinentry/pinentry.cpp @@ -18,36 +18,13 @@   * SPDX-License-Identifier: GPL-2.0+   */ -#include "GFModuleCommonUtils.hpp" -#include "GFSDKBasic.h" - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#ifndef WINDOWS -#include <errno.h> -#endif -#include <assert.h> -#include <stdlib.h> -#include <string.h> -#include <sys/stat.h> -#include <sys/types.h> -#include <unistd.h> -#ifndef WINDOWS -#include <sys/utsname.h> -#endif -#ifndef WINDOWS -#include <locale.h> -#endif -#include <limits.h> -#ifdef WINDOWS -#include <windows.h> -#endif +#include "pinentry.h"  #include <qhash.h> +#include <qstring.h> -#include "pinentry.h" +#include "GFModuleCommonUtils.hpp" +#include "GFSDKBasic.h"  #ifdef WINDOWS  #define getpid() GetCurrentProcessId() @@ -136,44 +113,6 @@ static char *get_pid_name_for_uid(unsigned long pid, int uid) {  const char *pinentry_get_pgmname(void) { return this_pgmname; } -/* Return a malloced string with the title.  The caller mus free the - * string.  If no title is available or the title string has an error - * NULL is returned.  */ -char *pinentry_get_title(pinentry_t pe) { -  char *title; - -  if (pe->title) title = strdup(pe->title); -#ifndef WINDOWS -  else if (pe->owner_pid) { -    char buf[200]; -    struct utsname utsbuf; -    char *pidname = NULL; -    char *cmdline = NULL; - -    if (pe->owner_host && !uname(&utsbuf) && -        !strcmp(utsbuf.nodename, pe->owner_host)) { -      pidname = get_pid_name_for_uid(pe->owner_pid, pe->owner_uid); -      if (pidname) cmdline = get_cmdline(pe->owner_pid); -    } - -    if (pe->owner_host && (cmdline || pidname)) -      snprintf(buf, sizeof buf, "[%lu]@%s (%s)", pe->owner_pid, pe->owner_host, -               cmdline ? cmdline : pidname); -    else if (pe->owner_host) -      snprintf(buf, sizeof buf, "[%lu]@%s", pe->owner_pid, pe->owner_host); -    else -      snprintf(buf, sizeof buf, "[%lu] <unknown host>", pe->owner_pid); -    free(pidname); -    free(cmdline); -    title = strdup(buf); -  } -#endif /*!WINDOWS*/ -  else -    title = strdup(this_pgmname); - -  return title; -} -  /* Run a quality inquiry for PASSPHRASE of LENGTH.  (We need LENGTH     because not all backends might be able to return a proper     C-string.).  Returns: A value between -100 and 100 to give an diff --git a/src/m_pinentry/pinentry.h b/src/m_pinentry/pinentry.h index 143a885..5c38c68 100644 --- a/src/m_pinentry/pinentry.h +++ b/src/m_pinentry/pinentry.h @@ -21,6 +21,8 @@  #ifndef PINENTRY_H  #define PINENTRY_H +#include <qstring.h> +  #include <cstdint>  #ifdef __cplusplus | 
