From Jos.Backus@nl.origin-it.com  Tue Aug  4 03:30:26 1998
Received: from gw-nl1.philips.com (gw-nl1.philips.com [192.68.44.33])
          by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id DAA00562
          for <FreeBSD-gnats-submit@freebsd.org>; Tue, 4 Aug 1998 03:30:25 -0700 (PDT)
          (envelope-from Jos.Backus@nl.origin-it.com)
Received: from smtprelay-nl1.philips.com (localhost.philips.com [127.0.0.1])
          by gw-nl1.philips.com with ESMTP id MAA14964
          for <FreeBSD-gnats-submit@freebsd.org>; Tue, 4 Aug 1998 12:30:07 +0200 (MEST)
          (envelope-from Jos.Backus@nl.origin-it.com)
Received: from hal.mpn.cp.philips.com (hal.mpn.cp.philips.com [130.139.64.195]) 
	by smtprelay-nl1.philips.com (8.8.5/8.6.10-1.2.2m-970826) with SMTP id MAA14430
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 4 Aug 1998 12:30:06 +0200 (MET DST)
Received: (qmail 8429 invoked by uid 666); 4 Aug 1998 10:28:09 -0000
Message-Id: <19980804102809.8428.qmail@hal.mpn.cp.philips.com>
Date: 4 Aug 1998 10:28:09 -0000
From: Jos.Backus@nl.origin-it.com
Reply-To: Jos.Backus@nl.origin-it.com
To: FreeBSD-gnats-submit@freebsd.org
Subject: rtprio gives misleading error message when execvp fails
X-Send-Pr-Version: 3.2

>Number:         7489
>Category:       bin
>Synopsis:       rtprio gives misleading error message when execvp fails
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Aug  4 03:40:01 PDT 1998
>Closed-Date:    Tue Aug 4 05:32:13 PDT 1998
>Last-Modified:  Tue Aug  4 05:32:46 PDT 1998
>Originator:     Jos Backus
>Release:        FreeBSD 3.0-CURRENT i386
>Organization:
Origin B.V.
>Environment:

	Both -stable and -current

>Description:

	If rtprio can't find the command you want it to run (e.g. because it
	is not in the current PATH), it will output its own name instead of
	the command in the resulting error message.

>How-To-Repeat:

	# export PATH=/usr/sbin
	# rtprio 5 ls
	rtprio: rtprio: No such file or directory
	# 

>Fix:
	Trivial: point err() to the correct argv element:

--- rtprio.c.orig       Tue May 19 22:52:31 1998
+++ rtprio.c    Tue Aug  4 12:21:13 1998
@@ -121,7 +121,7 @@

                if (proc == 0) {
                        execvp(argv[2], &argv[2]);
-                       err(1, "%s", argv[0]);
+                       err(1, "%s", argv[2]);
                }
        }
        exit (1);	
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: thepish 
State-Changed-When: Tue Aug 4 05:32:13 PDT 1998 
State-Changed-Why:  
Patch applied, Thankyou. 
>Unformatted:
