Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
db2f09ab
Commit
db2f09ab
authored
Aug 10, 2014
by
Paul Eggert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify previous patch.
Fixes: debbugs:18232
parent
f22bc725
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
10 deletions
+8
-10
lib/save-cwd.c
lib/save-cwd.c
+8
-10
No files found.
lib/save-cwd.c
View file @
db2f09ab
...
...
@@ -50,14 +50,14 @@
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)
#endif
int
save_cwd
(
struct
saved_cwd
*
cwd
)
{
#ifdef HAVE_FCHDIR
cwd
->
desc
=
open
(
"."
,
O_SEARCH
|
O_CLOEXEC
);
#else
cwd
->
desc
=
-
1
;
#endif
/* The 'name' member is present only to minimize differences from
gnulib. Initialize it to zero, if only to simplify debugging. */
cwd
->
name
=
0
;
...
...
@@ -71,16 +71,14 @@ save_cwd (struct saved_cwd *cwd)
int
restore_cwd
(
const
struct
saved_cwd
*
cwd
)
{
#ifdef HAVE_FCHDIR
/* Restore the previous directory if possible, to avoid tying down
the file system of the new directory (Bug#18232). */
the file system of the new directory (Bug#18232).
Don't worry if fchdir fails, as Emacs doesn't care what the
working directory is. The fchdir call is inside an 'if' merely to
pacify compilers that complain if fchdir's return value is ignored. */
if
(
fchdir
(
cwd
->
desc
)
==
0
)
return
0
;
/* Don't worry if fchdir fails, as Emacs doesn't care what the
working directory is. The fchdir call is inside an 'if' merely to
pacify compilers that complain if fchdir's return value is ignored. */
#endif
return
0
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment