summaryrefslogtreecommitdiff
path: root/apt-pkg/contrib/fileutl.cc
diff options
context:
space:
mode:
Diffstat (limited to 'apt-pkg/contrib/fileutl.cc')
-rw-r--r--apt-pkg/contrib/fileutl.cc9
1 files changed, 2 insertions, 7 deletions
diff --git a/apt-pkg/contrib/fileutl.cc b/apt-pkg/contrib/fileutl.cc
index 4f123491b..7e80e251c 100644
--- a/apt-pkg/contrib/fileutl.cc
+++ b/apt-pkg/contrib/fileutl.cc
@@ -27,6 +27,7 @@
#include <apt-pkg/pkgsystem.h>
#include <apt-pkg/sptr.h>
#include <apt-pkg/strutl.h>
+#include <apt-pkg/endian.h>
#include <cstdio>
#include <cstdlib>
@@ -2210,12 +2211,6 @@ public:
dup2(compressed_fd,STDIN_FILENO);
dup2(Pipe[1],STDOUT_FILENO);
}
- int const nullfd = open("/dev/null", O_WRONLY);
- if (nullfd != -1)
- {
- dup2(nullfd,STDERR_FILENO);
- close(nullfd);
- }
SetCloseExec(STDOUT_FILENO,false);
SetCloseExec(STDIN_FILENO,false);
@@ -3071,7 +3066,7 @@ static std::string APT_NONNULL(1) GetTempDirEnv(char const * const env) /*{{{*/
stat(tmpdir, &st) != 0 || (st.st_mode & S_IFDIR) == 0) // exists and is directory
tmpdir = "/tmp";
else if (geteuid() != 0 && // root can do everything anyway
- faccessat(AT_FDCWD, tmpdir, R_OK | W_OK | X_OK, AT_EACCESS) != 0) // current user has rwx access to directory
+ access(tmpdir, R_OK | W_OK | X_OK) != 0) // current user has rwx access to directory
tmpdir = "/tmp";
return string(tmpdir);