Fix bad error messages from dpv(3)
Before = dpv: <__func__>: posix_spawnp(3): No such file or directory After = dpv: <path/cmd>: No such file or directory Most notably, show the 2nd argument being passed to posix_spawnp(3) so we know what path/cmd failed. Also, we don't need to have "posix_spawnp(3)" in the error message nor the function because that can [a] change and [b] traversed using a debugger if necessary.
This commit is contained in:
parent
28c1fdff51
commit
cfeecda0a9
@ -1,5 +1,5 @@
|
|||||||
/*-
|
/*-
|
||||||
* Copyright (c) 2013-2014 Devin Teske <dteske@FreeBSD.org>
|
* Copyright (c) 2013-2018 Devin Teske <dteske@FreeBSD.org>
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -328,8 +328,7 @@ dialog_spawn_gauge(char *init_prompt, pid_t *pid)
|
|||||||
posix_spawn_file_actions_addclose(&action, stdin_pipe[1]);
|
posix_spawn_file_actions_addclose(&action, stdin_pipe[1]);
|
||||||
error = posix_spawnp(pid, dialog, &action,
|
error = posix_spawnp(pid, dialog, &action,
|
||||||
(const posix_spawnattr_t *)NULL, dargv, environ);
|
(const posix_spawnattr_t *)NULL, dargv, environ);
|
||||||
if (error != 0)
|
if (error != 0) err(EXIT_FAILURE, "%s", dialog);
|
||||||
err(EXIT_FAILURE, "%s: posix_spawnp(3)", __func__);
|
|
||||||
|
|
||||||
/* NB: Do not free(3) *dargv[], else SIGSEGV */
|
/* NB: Do not free(3) *dargv[], else SIGSEGV */
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*-
|
/*-
|
||||||
* Copyright (c) 2013-2014 Devin Teske <dteske@FreeBSD.org>
|
* Copyright (c) 2013-2018 Devin Teske <dteske@FreeBSD.org>
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -100,8 +100,7 @@ shell_spawn_pipecmd(const char *cmd, const char *label, pid_t *pid)
|
|||||||
posix_spawn_file_actions_addclose(&action, stdin_pipe[1]);
|
posix_spawn_file_actions_addclose(&action, stdin_pipe[1]);
|
||||||
error = posix_spawnp(pid, shellcmd, &action,
|
error = posix_spawnp(pid, shellcmd, &action,
|
||||||
(const posix_spawnattr_t *)NULL, shellcmd_argv, environ);
|
(const posix_spawnattr_t *)NULL, shellcmd_argv, environ);
|
||||||
if (error != 0)
|
if (error != 0) err(EXIT_FAILURE, "%s", shellcmd);
|
||||||
err(EXIT_FAILURE, "%s: posix_spawnp(3)", __func__);
|
|
||||||
|
|
||||||
return stdin_pipe[1];
|
return stdin_pipe[1];
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user