From owner-svn-src-stable@freebsd.org Wed Jun 20 05:45:42 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7E52C1001B6D; Wed, 20 Jun 2018 05:45:42 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2A09E686F7; Wed, 20 Jun 2018 05:45:42 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 087C41E2F1; Wed, 20 Jun 2018 05:45:42 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5K5jfLu094125; Wed, 20 Jun 2018 05:45:41 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5K5jfa7094123; Wed, 20 Jun 2018 05:45:41 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201806200545.w5K5jfa7094123@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Wed, 20 Jun 2018 05:45:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r335406 - stable/11/lib/libdpv X-SVN-Group: stable-11 X-SVN-Commit-Author: dteske X-SVN-Commit-Paths: stable/11/lib/libdpv X-SVN-Commit-Revision: 335406 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jun 2018 05:45:42 -0000 Author: dteske Date: Wed Jun 20 05:45:41 2018 New Revision: 335406 URL: https://svnweb.freebsd.org/changeset/base/335406 Log: dpv(3): MFC r330943, r335264 r330943: Fix bad error messages from dpv(3) Before = dpv: <__func__>: posix_spawnp(3): No such file or directory After = dpv: : 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. r335264: Fix comparison between pointer and char literal PR: misc/204252 Reported by: David Binderman Sponsored by: Smule, Inc. Modified: stable/11/lib/libdpv/dialog_util.c stable/11/lib/libdpv/dprompt.c stable/11/lib/libdpv/util.c Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libdpv/dialog_util.c ============================================================================== --- stable/11/lib/libdpv/dialog_util.c Wed Jun 20 05:10:30 2018 (r335405) +++ stable/11/lib/libdpv/dialog_util.c Wed Jun 20 05:45:41 2018 (r335406) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013-2014 Devin Teske + * Copyright (c) 2013-2018 Devin Teske * All rights reserved. * * 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]); error = posix_spawnp(pid, dialog, &action, (const posix_spawnattr_t *)NULL, dargv, environ); - if (error != 0) - err(EXIT_FAILURE, "%s: posix_spawnp(3)", __func__); + if (error != 0) err(EXIT_FAILURE, "%s", dialog); /* NB: Do not free(3) *dargv[], else SIGSEGV */ Modified: stable/11/lib/libdpv/dprompt.c ============================================================================== --- stable/11/lib/libdpv/dprompt.c Wed Jun 20 05:10:30 2018 (r335405) +++ stable/11/lib/libdpv/dprompt.c Wed Jun 20 05:45:41 2018 (r335406) @@ -89,7 +89,7 @@ spin_char(void) { char ch; - if (spin_cp == '\0') + if (*spin_cp == '\0') spin_cp = spin; ch = *spin_cp; Modified: stable/11/lib/libdpv/util.c ============================================================================== --- stable/11/lib/libdpv/util.c Wed Jun 20 05:10:30 2018 (r335405) +++ stable/11/lib/libdpv/util.c Wed Jun 20 05:45:41 2018 (r335406) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013-2014 Devin Teske + * Copyright (c) 2013-2018 Devin Teske * 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 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]; }