projects
/
gnulib.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Complete comments.
[gnulib.git]
/
lib
/
save-cwd.c
diff --git
a/lib/save-cwd.c
b/lib/save-cwd.c
index
7f1b30b
..
f842cca
100644
(file)
--- a/
lib/save-cwd.c
+++ b/
lib/save-cwd.c
@@
-25,20
+25,14
@@
#include "save-cwd.h"
#include "save-cwd.h"
+#include <errno.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
-
-#if HAVE_UNISTD_H
-# include <unistd.h>
-#endif
-
-#include <fcntl.h>
-
-#include <errno.h>
+#include <unistd.h>
#include "chdir-long.h"
#include "chdir-long.h"
-#include "
unistd-safer
.h"
+#include "
fcntl--
.h"
#include "xgetcwd.h"
/* On systems without the fchdir function (WOE), pretend that open
#include "xgetcwd.h"
/* On systems without the fchdir function (WOE), pretend that open
@@
-78,15
+72,11
@@
save_cwd (struct saved_cwd *cwd)
{
cwd->name = NULL;
{
cwd->name = NULL;
- cwd->desc =
fd_safer (open (".", O_RDONLY)
);
+ cwd->desc =
open (".", O_RDONLY
);
if (cwd->desc < 0)
{
if (cwd->desc < 0)
{
- cwd->desc = fd_safer (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;
}
return 0;