summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gardner <bgardner@wabtec.com>2016-05-24 17:34:10 -0500
committerBen Gardner <bgardner@wabtec.com>2016-05-24 17:34:10 -0500
commite11e91d9399c411d5712728f46e66eb04e24a21d (patch)
treef87dacde0ecbe481d169f6728937fbefc0014879
parentddd734de3ec02d9b73b561dac95b94c63a2ae86a (diff)
downloaddropbear-e11e91d9399c411d5712728f46e66eb04e24a21d.tar.gz
Use DROPBEAR_PATH_DEVNULL instead of undefined _PATH_DEVNULL
-rw-r--r--cli-session.c2
-rw-r--r--compat.c2
-rw-r--r--scpmisc.c2
3 files changed, 3 insertions, 3 deletions
diff --git a/cli-session.c b/cli-session.c
index d89416f..d8525ae 100644
--- a/cli-session.c
+++ b/cli-session.c
@@ -287,7 +287,7 @@ static void cli_sessionloop() {
int devnull;
/* keeping stdin open steals input from the terminal and
is confusing, though stdout/stderr could be useful. */
- devnull = open(_PATH_DEVNULL, O_RDONLY);
+ devnull = open(DROPBEAR_PATH_DEVNULL, O_RDONLY);
if (devnull < 0) {
dropbear_exit("Opening /dev/null: %d %s",
errno, strerror(errno));
diff --git a/compat.c b/compat.c
index 71558a5..f3e9a52 100644
--- a/compat.c
+++ b/compat.c
@@ -177,7 +177,7 @@ int daemon(int nochdir, int noclose) {
if (!nochdir)
(void)chdir("/");
- if (!noclose && (fd = open(_PATH_DEVNULL, O_RDWR, 0)) != -1) {
+ if (!noclose && (fd = open(DROPBEAR_PATH_DEVNULL, O_RDWR, 0)) != -1) {
(void)dup2(fd, STDIN_FILENO);
(void)dup2(fd, STDOUT_FILENO);
(void)dup2(fd, STDERR_FILENO);
diff --git a/scpmisc.c b/scpmisc.c
index d99e358..33e1891 100644
--- a/scpmisc.c
+++ b/scpmisc.c
@@ -235,7 +235,7 @@ sanitise_stdfd(void)
{
int nullfd, dupfd;
- if ((nullfd = dupfd = open(_PATH_DEVNULL, O_RDWR)) == -1) {
+ if ((nullfd = dupfd = open(DROPBEAR_PATH_DEVNULL, O_RDWR)) == -1) {
fprintf(stderr, "Couldn't open /dev/null: %s", strerror(errno));
exit(1);
}