Paul Eggert <[EMAIL PROTECTED]> wrote:
...
> As a result of this patch, getcwd is limited only by available memory
> on hosts like Solaris that support AT_FDCWD.  Maybe we should alter
> coreutils/src/pwd.c to not use the "robust getcwd" algorithm on hosts
> with AT_FDCWD, since it's useless code on those hosts?

Thanks again for the nice patch.

However, having getcwd return directory names not restricted
by PATH_MAX may cause undesirable changes in behavior.

For example, save-cwd.c resorts to using getcwd (via xgetcwd) in some
cases.  Before this change, if the working directory name was too long,
save_cwd's xgetcwd call would fail, and the save_cwd caller would
learn right away about the problem.  Now, the caller won't find out
until it tries to return to that long-named directory and fails due to
restore_cwd's attempted chdir.

Maybe we should see this as an opportunity to write a robust wrapper
around chdir itself: if it fails because of ENAMETOOLONG, then have it
resort to retrying with shorter portions of the long name.


_______________________________________________
Bug-coreutils mailing list
[EMAIL PROTECTED]
http://lists.gnu.org/mailman/listinfo/bug-coreutils

Reply via email to