Show/log the strerror(errno) string when getcwd fails
This commit is contained in:
parent
554cce1e94
commit
7ccec6ac9f
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: conf.c,v 1.12 1998/06/03 09:21:46 hubertf Exp $ */
|
||||
/* $NetBSD: conf.c,v 1.13 1998/06/03 13:21:42 mouse Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1997 The NetBSD Foundation, Inc.
|
||||
|
@ -38,7 +38,7 @@
|
|||
|
||||
#include <sys/cdefs.h>
|
||||
#ifndef lint
|
||||
__RCSID("$NetBSD: conf.c,v 1.12 1998/06/03 09:21:46 hubertf Exp $");
|
||||
__RCSID("$NetBSD: conf.c,v 1.13 1998/06/03 13:21:42 mouse Exp $");
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/types.h>
|
||||
|
@ -322,7 +322,7 @@ show_chdir_messages(code)
|
|||
|
||||
/* Check if this directory has already been visited */
|
||||
if (getcwd(cwd, sizeof(cwd) - 1) == NULL) {
|
||||
syslog(LOG_WARNING, "can't getcwd");
|
||||
syslog(LOG_WARNING, "can't getcwd: %s", strerror(errno));
|
||||
return;
|
||||
}
|
||||
if (sl_find(slist, cwd) != NULL)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: ftpd.c,v 1.47 1998/06/03 09:21:45 hubertf Exp $ */
|
||||
/* $NetBSD: ftpd.c,v 1.48 1998/06/03 13:21:42 mouse Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1985, 1988, 1990, 1992, 1993, 1994
|
||||
|
@ -44,7 +44,7 @@ __COPYRIGHT(
|
|||
#if 0
|
||||
static char sccsid[] = "@(#)ftpd.c 8.5 (Berkeley) 4/28/95";
|
||||
#else
|
||||
__RCSID("$NetBSD: ftpd.c,v 1.47 1998/06/03 09:21:45 hubertf Exp $");
|
||||
__RCSID("$NetBSD: ftpd.c,v 1.48 1998/06/03 13:21:42 mouse Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
|
@ -1498,7 +1498,8 @@ pwd()
|
|||
char path[MAXPATHLEN + 1];
|
||||
|
||||
if (getcwd(path, sizeof(path) - 1) == NULL)
|
||||
reply(550, "Can't get the current directory.");
|
||||
reply(550, "Can't get the current directory: %s.",
|
||||
strerror(errno));
|
||||
else
|
||||
replydirname(path, "is the current directory.");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue