From 128bfa6d44277632f6bce98ebbfab4a58f42bda7 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 19 Jan 2026 10:53:33 -0800 Subject: [PATCH] Merge Gnulib save-cwd.c changes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * lib/save-cwd.c: Propagate changes from Gnulib sibling. This doesn’t affect behavior. --- lib/save-cwd.c | 17 +++++++++-------- 1 file 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; }