(save_cwd): Don't bother trying to open directory

for write access: POSIX says that must fail.
This commit is contained in:
Paul Eggert 2005-12-27 07:57:14 +00:00
parent ee7334652f
commit 97fe820f88

View File

@ -75,12 +75,8 @@ save_cwd (struct saved_cwd *cwd)
cwd->desc = open (".", O_RDONLY);
if (cwd->desc < 0)
{
cwd->desc = open (".", O_WRONLY);
if (cwd->desc < 0)
{
cwd->name = xgetcwd ();
return cwd->name ? 0 : -1;
}
cwd->name = xgetcwd ();
return cwd->name ? 0 : -1;
}
return 0;