summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2026-01-19 10:53:33 -0800
committerPaul Eggert <eggert@cs.ucla.edu>2026-01-19 12:49:15 -0800
commit128bfa6d44277632f6bce98ebbfab4a58f42bda7 (patch)
treebc897e0a773fa03c0f1ff7594c09178b1a5ca00a /lib
parent5eb9800c420ca6d889313e462b4a89b45cf97577 (diff)
Merge Gnulib save-cwd.c changes
* lib/save-cwd.c: Propagate changes from Gnulib sibling. This doesn’t affect behavior.
Diffstat (limited to 'lib')
-rw-r--r--lib/save-cwd.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/lib/save-cwd.c b/lib/save-cwd.c
index b1e55067327..ca52f72a90c 100644
--- a/lib/save-cwd.c
+++ b/lib/save-cwd.c
@@ -5,7 +5,7 @@
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3 of the License, or
+ the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
@@ -45,10 +45,10 @@
the getcwd-lgpl module, but to be truly robust, use the getcwd module.
Some systems lack fchdir altogether: e.g., OS/2, pre-2001 Cygwin,
- SCO Xenix. Also, SunOS 4 and Irix 5.3 provide the function, yet it
- doesn't work for partitions on which auditing is enabled. If
- you're still using an obsolete system with these problems, please
- send email to the maintainer of this code. */
+ SCO Xenix. Also, SunOS 4 provides the function, yet it doesn't work
+ for partitions on which auditing is enabled. If you're still using
+ an obsolete system with these problems, please send email to the
+ maintainer of this code. */
#if !defined HAVE_FCHDIR && !defined fchdir
# define fchdir(fd) (-1)
@@ -57,10 +57,11 @@
int
save_cwd (struct saved_cwd *cwd)
{
- cwd->desc = open (".", O_SEARCH | O_CLOEXEC);
/* The 'name' member is present only to minimize differences from
- gnulib. Initialize it to zero, if only to simplify debugging. */
- cwd->name = 0;
+ gnulib. Initialize it to NULL, if only to simplify debugging. */
+ cwd->name = NULL;
+
+ cwd->desc = open (".", O_SEARCH | O_CLOEXEC);
return 0;
}