summaryrefslogtreecommitdiff
path: root/tools/gpg-connect-agent.c
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2021-02-09 16:00:19 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2021-02-09 16:00:19 +0900
commitd9787447fe6a57e39113b60305b4ab672b9ba897 (patch)
tree6c925adf6340a1a5ab43d9048ca4b27eae819cd6 /tools/gpg-connect-agent.c
parentf77eedfaad1525168ca8593a3eb43ef157cd2891 (diff)
downloadgpg2-d9787447fe6a57e39113b60305b4ab672b9ba897.tar.gz
gpg2-d9787447fe6a57e39113b60305b4ab672b9ba897.tar.bz2
gpg2-d9787447fe6a57e39113b60305b4ab672b9ba897.zip
Imported Upstream version 2.1.19upstream/2.1.19
Diffstat (limited to 'tools/gpg-connect-agent.c')
-rw-r--r--tools/gpg-connect-agent.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/tools/gpg-connect-agent.c b/tools/gpg-connect-agent.c
index a5413cf..59e2192 100644
--- a/tools/gpg-connect-agent.c
+++ b/tools/gpg-connect-agent.c
@@ -187,7 +187,7 @@ static assuan_context_t start_agent (void);
-/* Print usage information and and provide strings for help. */
+/* Print usage information and provide strings for help. */
static const char *
my_strusage( int level )
{
@@ -1155,7 +1155,7 @@ main (int argc, char **argv)
int rc;
int cmderr;
const char *opt_run = NULL;
- FILE *script_fp = NULL;
+ gpgrt_stream_t script_fp = NULL;
int use_tty, keep_line;
struct {
int collecting;
@@ -1271,7 +1271,7 @@ main (int argc, char **argv)
"--tcp-socket", "--raw-socket");
}
- if (opt_run && !(script_fp = fopen (opt_run, "r")))
+ if (opt_run && !(script_fp = gpgrt_fopen (opt_run, "r")))
{
log_error ("cannot open run file '%s': %s\n",
opt_run, strerror (errno));
@@ -1425,15 +1425,15 @@ main (int argc, char **argv)
linesize = 0;
keep_line = 1;
}
- n = read_line (script_fp? script_fp:stdin,
- &line, &linesize, &maxlength);
+ n = gpgrt_read_line (script_fp ? script_fp : gpgrt_stdin,
+ &line, &linesize, &maxlength);
}
if (n < 0)
{
log_error (_("error reading input: %s\n"), strerror (errno));
if (script_fp)
{
- fclose (script_fp);
+ gpgrt_fclose (script_fp);
script_fp = NULL;
log_error ("stopping script execution\n");
continue;
@@ -1445,7 +1445,7 @@ main (int argc, char **argv)
/* EOF */
if (script_fp)
{
- fclose (script_fp);
+ gpgrt_fclose (script_fp);
script_fp = NULL;
if (opt.verbose)
log_info ("end of script\n");
@@ -1683,17 +1683,17 @@ main (int argc, char **argv)
log_error ("syntax error in run command\n");
if (script_fp)
{
- fclose (script_fp);
+ gpgrt_fclose (script_fp);
script_fp = NULL;
}
}
else if (script_fp)
{
log_error ("cannot nest run commands - stop\n");
- fclose (script_fp);
+ gpgrt_fclose (script_fp);
script_fp = NULL;
}
- else if (!(script_fp = fopen (p, "r")))
+ else if (!(script_fp = gpgrt_fopen (p, "r")))
{
log_error ("cannot open run file '%s': %s\n",
p, strerror (errno));
@@ -1864,7 +1864,7 @@ main (int argc, char **argv)
if ((rc || cmderr) && script_fp)
{
log_error ("stopping script execution\n");
- fclose (script_fp);
+ gpgrt_fclose (script_fp);
script_fp = NULL;
}