diff options
Diffstat (limited to 'common')
-rw-r--r-- | common/helpfile.c | 12 | ||||
-rw-r--r-- | common/sysutils.c | 2 |
2 files changed, 8 insertions, 6 deletions
diff --git a/common/helpfile.c b/common/helpfile.c index 7cb01a443..7a7a2358a 100644 --- a/common/helpfile.c +++ b/common/helpfile.c @@ -41,14 +41,14 @@ static char * findkey_fname (const char *key, const char *fname) { gpg_error_t err = 0; - FILE *fp; + estream_t fp; int lnr = 0; int c; char *p, line[256]; int in_item = 0; membuf_t mb = MEMBUF_ZERO; - fp = fopen (fname, "r"); + fp = es_fopen (fname, "r"); if (!fp) { if (errno != ENOENT) @@ -59,14 +59,14 @@ findkey_fname (const char *key, const char *fname) return NULL; } - while (fgets (line, DIM(line)-1, fp)) + while (es_fgets (line, DIM(line)-1, fp)) { lnr++; if (!*line || line[strlen(line)-1] != '\n') { /* Eat until end of line. */ - while ( (c=getc (fp)) != EOF && c != '\n') + while ((c = es_getc (fp)) != EOF && c != '\n') ; err = gpg_error (*line? GPG_ERR_LINE_TOO_LONG : GPG_ERR_INCOMPLETE_LINE); @@ -130,14 +130,14 @@ findkey_fname (const char *key, const char *fname) } } - if ( !err && ferror (fp) ) + if ( !err && es_ferror (fp) ) { err = gpg_error_from_syserror (); log_error (_("error reading '%s', line %d: %s\n"), fname, lnr, gpg_strerror (err)); } - fclose (fp); + es_fclose (fp); if (is_membuf_ready (&mb)) { /* We have collected something. */ diff --git a/common/sysutils.c b/common/sysutils.c index 99bc021f5..6738da108 100644 --- a/common/sysutils.c +++ b/common/sysutils.c @@ -1068,6 +1068,7 @@ gnupg_access (const char *name, int mode) /* Try to set an envvar. Print only a notice on error. */ +#ifndef HAVE_W32_SYSTEM static void try_set_envvar (const char *name, const char *value, int silent) { @@ -1076,6 +1077,7 @@ try_set_envvar (const char *name, const char *value, int silent) log_info ("error setting envvar %s to '%s': %s\n", name, value, gpg_strerror (my_error_from_syserror ())); } +#endif /*!HAVE_W32_SYSTEM*/ /* Switch to USER which is either a name or an UID. This is a nop |