comparison compat.c @ 1388:271c57aa3da5

Merge pull request #31 from bengardner/PATH_DEVNULL Use DROPBEAR_PATH_DEVNULL instead of undefined _PATH_DEVNULL
author Matt Johnston <matt@ucc.asn.au>
date Fri, 02 Jun 2017 22:57:09 +0800
parents 826a3293fe5a e7f11ed5fe28
children
comparison
equal deleted inserted replaced
1345:1a3c4ec0f840 1388:271c57aa3da5
172 return -1; 172 return -1;
173 173
174 if (!nochdir) 174 if (!nochdir)
175 (void)chdir("/"); 175 (void)chdir("/");
176 176
177 if (!noclose && (fd = open(_PATH_DEVNULL, O_RDWR, 0)) != -1) { 177 if (!noclose && (fd = open(DROPBEAR_PATH_DEVNULL, O_RDWR, 0)) != -1) {
178 (void)dup2(fd, STDIN_FILENO); 178 (void)dup2(fd, STDIN_FILENO);
179 (void)dup2(fd, STDOUT_FILENO); 179 (void)dup2(fd, STDOUT_FILENO);
180 (void)dup2(fd, STDERR_FILENO); 180 (void)dup2(fd, STDERR_FILENO);
181 if (fd > STDERR_FILENO) 181 if (fd > STDERR_FILENO)
182 (void)close(fd); 182 (void)close(fd);