From: Jim Meyering Date: Tue, 23 Nov 2004 09:44:17 +0000 (+0000) Subject: tweak comment X-Git-Tag: v5.3.0~347 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b90f1a4404ce7105acd424288af23bcc3f344c62;p=thirdparty%2Fcoreutils.git tweak comment --- diff --git a/src/pwd.c b/src/pwd.c index 96b3013962..787f46582e 100644 --- a/src/pwd.c +++ b/src/pwd.c @@ -247,7 +247,7 @@ find_dir_entry (struct stat *dot_sb, struct Path *path, size_t parent_height) /* Construct the full, absolute name of the current working directory and store it in *PATH. - The getcwd function does nearly the same task, but is typically + The getcwd function performs nearly the same task, but is typically unable to handle names longer than PATH_MAX. This function has no such limitation. However, this function *can* fail due to permission problems or a lack of memory, while Linux's getcwd @@ -260,6 +260,9 @@ find_dir_entry (struct stat *dot_sb, struct Path *path, size_t parent_height) used as a getcwd replacement. Unfortunately, considering all of the information the caller would require in order to produce good diagnostics, it doesn't seem worth the added complexity. + In any case, any getcwd replacement must *not* exceed the PATH_MAX + limitation. Otherwise, functions like `chdir' would fail with + ENAMETOOLONG. FIXME-maybe: if find_dir_entry fails due to permissions, try getcwd, in case the unreadable directory is close enough to the root that