aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Seebach <peter.seebach@windriver.com>2010-09-02 14:37:10 -0500
committerPeter Seebach <peter.seebach@windriver.com>2010-09-02 14:39:28 -0500
commit53569b51816ee5a244a2426fe1546c06c12af915 (patch)
tree59c32110f4d84ab0f9caa45db746c07795a3cd87
parent03e3352b66bd02d802d74e0e5c556ac26d87a04c (diff)
downloadpseudo-53569b51816ee5a244a2426fe1546c06c12af915.tar.gz
pseudo-53569b51816ee5a244a2426fe1546c06c12af915.tar.bz2
pseudo-53569b51816ee5a244a2426fe1546c06c12af915.zip
Wait, the man page says we give ERANGE for that, not ENAMETOOLONG.
... Also, make that error message a debugging message, since that's a normal and legitimate use case.
-rw-r--r--ChangeLog.txt3
-rw-r--r--guts/getcwd.c4
2 files changed, 5 insertions, 2 deletions
diff --git a/ChangeLog.txt b/ChangeLog.txt
index 42424cd..534041e 100644
--- a/ChangeLog.txt
+++ b/ChangeLog.txt
@@ -1,3 +1,6 @@
+2010-09-02:
+ * (seebs) fix errno for getcwd() with insufficient size
+
2010-09-01:
* (seebs) add missing casts to even more printf arguments
diff --git a/guts/getcwd.c b/guts/getcwd.c
index 2537e94..b3f552c 100644
--- a/guts/getcwd.c
+++ b/guts/getcwd.c
@@ -44,12 +44,12 @@
}
}
if (pseudo_cwd_len - (pseudo_cwd_rel - pseudo_cwd) >= size) {
- pseudo_diag("only %ld bytes available, need %ld (%ld + 1 - %ld)\n",
+ pseudo_debug(1, "only %ld bytes available, need %ld (%ld + 1 - %ld)\n",
(unsigned long) size,
(unsigned long) pseudo_cwd_len + 1 - pseudo_chroot_len,
(unsigned long) pseudo_cwd_len,
(unsigned long) pseudo_chroot_len);
- errno = ENAMETOOLONG;
+ errno = ERANGE;
return NULL;
}
rc = buf;