mirror of
https://github.com/coreutils/coreutils.git
synced 2024-12-01 14:03:30 +08:00
(save_cwd): Don't bother trying to open directory
for write access: POSIX says that must fail.
This commit is contained in:
parent
ee7334652f
commit
97fe820f88
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user