getcwd() is not equivalent of getwd() if you want to print an error message.
This commit is contained in:
parent
9d51ff8e34
commit
6b676a3cca
@ -1,4 +1,4 @@
|
|||||||
/* $NetBSD: mtree.c,v 1.12 1998/12/03 23:33:10 thorpej Exp $ */
|
/* $NetBSD: mtree.c,v 1.13 1998/12/05 03:29:25 itohy Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 1989, 1990, 1993
|
* Copyright (c) 1989, 1990, 1993
|
||||||
@ -43,7 +43,7 @@ __COPYRIGHT("@(#) Copyright (c) 1989, 1990, 1993\n\
|
|||||||
#if 0
|
#if 0
|
||||||
static char sccsid[] = "@(#)mtree.c 8.1 (Berkeley) 6/6/93";
|
static char sccsid[] = "@(#)mtree.c 8.1 (Berkeley) 6/6/93";
|
||||||
#else
|
#else
|
||||||
__RCSID("$NetBSD: mtree.c,v 1.12 1998/12/03 23:33:10 thorpej Exp $");
|
__RCSID("$NetBSD: mtree.c,v 1.13 1998/12/05 03:29:25 itohy Exp $");
|
||||||
#endif
|
#endif
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
@ -141,7 +141,7 @@ main(argc, argv)
|
|||||||
mtree_err("%s: %s", dir, strerror(errno));
|
mtree_err("%s: %s", dir, strerror(errno));
|
||||||
|
|
||||||
if ((cflag || sflag) && !getcwd(fullpath, MAXPATHLEN))
|
if ((cflag || sflag) && !getcwd(fullpath, MAXPATHLEN))
|
||||||
mtree_err("%s", fullpath);
|
mtree_err("%s", strerror(errno));
|
||||||
|
|
||||||
if (cflag) {
|
if (cflag) {
|
||||||
cwalk();
|
cwalk();
|
||||||
|
Loading…
Reference in New Issue
Block a user