mirror of
git://git.gnupg.org/gnupg.git
synced 2024-12-21 10:09:57 +01:00
tests:gpgscm: Raise an error correctly for process spawning.
* tests/gpgscm/ffi.c (do_process_spawn_io): Handle ERR. (do_process_spawn_fd): Likewise. -- Reported-by: Marcel Telka <marcel@telka.sk> Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
parent
ff63ffa606
commit
b08d990607
@ -936,10 +936,18 @@ do_process_spawn_io (scheme *sc, pointer args)
|
|||||||
|
|
||||||
err = gpgrt_process_spawn (argv[0], (const char **) &argv[1],
|
err = gpgrt_process_spawn (argv[0], (const char **) &argv[1],
|
||||||
flags, NULL, &proc);
|
flags, NULL, &proc);
|
||||||
err = gpgrt_process_get_streams (proc, 0, &infp, NULL, NULL);
|
if (err)
|
||||||
|
{
|
||||||
|
xfree (argv);
|
||||||
|
FFI_RETURN_ERR (sc, err);
|
||||||
|
}
|
||||||
|
|
||||||
err = es_write (infp, a_input, strlen (a_input), NULL);
|
err = gpgrt_process_get_streams (proc, 0, &infp, NULL, NULL);
|
||||||
es_fclose (infp);
|
if (!err)
|
||||||
|
{
|
||||||
|
err = es_write (infp, a_input, strlen (a_input), NULL);
|
||||||
|
es_fclose (infp);
|
||||||
|
}
|
||||||
if (err)
|
if (err)
|
||||||
{
|
{
|
||||||
gpgrt_process_release (proc);
|
gpgrt_process_release (proc);
|
||||||
@ -1198,6 +1206,8 @@ do_process_spawn_fd (scheme *sc, pointer args)
|
|||||||
err = gpgrt_process_spawn (argv[0], (const char **)&argv[1], 0, act, &proc);
|
err = gpgrt_process_spawn (argv[0], (const char **)&argv[1], 0, act, &proc);
|
||||||
gpgrt_spawn_actions_release (act);
|
gpgrt_spawn_actions_release (act);
|
||||||
xfree (argv);
|
xfree (argv);
|
||||||
|
if (err)
|
||||||
|
FFI_RETURN_ERR (sc, err);
|
||||||
FFI_RETURN_POINTER (sc, proc_wrap (sc, proc));
|
FFI_RETURN_POINTER (sc, proc_wrap (sc, proc));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user