mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-20 15:43:16 +00:00
Additionly print strerror(errno), when getwd() fails to start
in initial directory. Obtained from: idea from NetBSD
This commit is contained in:
parent
32d0c07493
commit
e77fe975bb
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=9259
@ -30,7 +30,7 @@
|
|||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* $Id: dir.c,v 1.2 1994/09/24 02:53:54 davidg Exp $
|
* $Id: dir.c,v 1.3 1995/05/30 00:06:30 rgrimes Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
@ -84,7 +84,7 @@ dinit(hp)
|
|||||||
/* Don't believe the login shell home, because it may be a symlink */
|
/* Don't believe the login shell home, because it may be a symlink */
|
||||||
tcp = getwd(path); /* see ngetwd.c for System V version */
|
tcp = getwd(path); /* see ngetwd.c for System V version */
|
||||||
if (tcp == NULL || *tcp == '\0') {
|
if (tcp == NULL || *tcp == '\0') {
|
||||||
(void) fprintf(csherr, "csh: %s\n", path);
|
(void) fprintf(csherr, "csh: %s: %s\n", path, strerror(errno));
|
||||||
if (hp && *hp) {
|
if (hp && *hp) {
|
||||||
tcp = short2str(hp);
|
tcp = short2str(hp);
|
||||||
if (chdir(tcp) == -1)
|
if (chdir(tcp) == -1)
|
||||||
|
Loading…
Reference in New Issue
Block a user