aboutsummaryrefslogtreecommitdiff
path: root/lib/libdpv/util.c
diff options
context:
space:
mode:
authorDevin Teske <dteske@FreeBSD.org>2018-03-14 19:23:17 +0000
committerDevin Teske <dteske@FreeBSD.org>2018-03-14 19:23:17 +0000
commitcfeecda0a9b4fa43827226ceb00b6e041ad300e8 (patch)
tree927ac2404a27445ee640c298311de993c4cfe08f /lib/libdpv/util.c
parent28c1fdff5148f999b257f50ea6e81eb891eea565 (diff)
downloadsrc-cfeecda0a9b4fa43827226ceb00b6e041ad300e8.tar.gz
src-cfeecda0a9b4fa43827226ceb00b6e041ad300e8.zip
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.
Notes
Notes: svn path=/head/; revision=330943
Diffstat (limited to 'lib/libdpv/util.c')
-rw-r--r--lib/libdpv/util.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/libdpv/util.c b/lib/libdpv/util.c
index 25fc1cb03397..5750f810c4ae 100644
--- a/lib/libdpv/util.c
+++ b/lib/libdpv/util.c
@@ -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.
*
* 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]);
error = posix_spawnp(pid, shellcmd, &action,
(const posix_spawnattr_t *)NULL, shellcmd_argv, environ);
- if (error != 0)
- err(EXIT_FAILURE, "%s: posix_spawnp(3)", __func__);
+ if (error != 0) err(EXIT_FAILURE, "%s", shellcmd);
return stdin_pipe[1];
}