1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-12-22 10:19:57 +01:00

Support gnupg_process_spawn with R_PROC=NULL.

--

The use case of system(3) call.

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
NIIBE Yutaka 2022-11-25 13:04:57 +09:00
parent af4a6fff0d
commit 62496e9f30
No known key found for this signature in database
GPG Key ID: 640114AF89DE6054
2 changed files with 18 additions and 3 deletions

View File

@ -1118,6 +1118,7 @@ gnupg_process_spawn (const char *pgmname, const char *argv1[],
check_syscall_func ();
if (r_process)
*r_process = NULL;
/* Create the command line argument array. */
@ -1305,6 +1306,13 @@ gnupg_process_spawn (const char *pgmname, const char *argv1[],
process->wstatus = -1;
process->terminated = 0;
if (r_process == NULL)
{
ec = gnupg_process_wait (process, 1);
gnupg_process_release (process);
return ec;
}
*r_process = process;
return 0;
}
@ -1496,7 +1504,6 @@ gnupg_process_wait (gnupg_process_t process, int hang)
int status;
pid_t pid;
if (process->terminated)
/* Already terminated. */
return 0;

View File

@ -1224,6 +1224,7 @@ gnupg_process_spawn (const char *pgmname, const char *argv[],
check_syscall_func ();
if (r_process)
*r_process = NULL;
/* Build the command line. */
@ -1486,6 +1487,13 @@ gnupg_process_spawn (const char *pgmname, const char *argv[],
process->exitcode = -1;
process->terminated = 0;
if (r_process == NULL)
{
ec = gnupg_process_wait (process, 1);
gnupg_process_release (process);
return ec;
}
*r_process = process;
return 0;
}