From owner-svn-src-head@FreeBSD.ORG Wed May 25 21:38:17 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 336F31065675; Wed, 25 May 2011 21:38:17 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DFE418FC20; Wed, 25 May 2011 21:38:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4PLcGl5031299; Wed, 25 May 2011 21:38:16 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4PLcGdt031297; Wed, 25 May 2011 21:38:16 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201105252138.p4PLcGdt031297@svn.freebsd.org> From: Jilles Tjoelker Date: Wed, 25 May 2011 21:38:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222292 - head/bin/sh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 May 2011 21:38:17 -0000 Author: jilles Date: Wed May 25 21:38:16 2011 New Revision: 222292 URL: http://svn.freebsd.org/changeset/base/222292 Log: sh: Show errno messages in cd. Modified: head/bin/sh/cd.c Modified: head/bin/sh/cd.c ============================================================================== --- head/bin/sh/cd.c Wed May 25 21:17:53 2011 (r222291) +++ head/bin/sh/cd.c Wed May 25 21:38:16 2011 (r222292) @@ -86,6 +86,7 @@ cdcmd(int argc, char **argv) struct stat statb; int ch, phys, print = 0, getcwderr = 0; int rc; + int errno1 = ENOENT; optreset = 1; optind = 1; opterr = 0; /* initialize getopt */ phys = Pflag; @@ -138,9 +139,11 @@ cdcmd(int argc, char **argv) rc = docd(p, print, phys); if (rc >= 0) return getcwderr ? rc : 0; + if (errno != ENOENT) + errno1 = errno; } } - error("can't cd to %s", dest); + error("%s: %s", dest, strerror(errno1)); /*NOTREACHED*/ return 0; }