Mercurial > dropbear
comparison scpmisc.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 | e7f11ed5fe28 |
children | 9579377b5f8b |
comparison
equal
deleted
inserted
replaced
1345:1a3c4ec0f840 | 1388:271c57aa3da5 |
---|---|
233 void | 233 void |
234 sanitise_stdfd(void) | 234 sanitise_stdfd(void) |
235 { | 235 { |
236 int nullfd, dupfd; | 236 int nullfd, dupfd; |
237 | 237 |
238 if ((nullfd = dupfd = open(_PATH_DEVNULL, O_RDWR)) == -1) { | 238 if ((nullfd = dupfd = open(DROPBEAR_PATH_DEVNULL, O_RDWR)) == -1) { |
239 fprintf(stderr, "Couldn't open /dev/null: %s", strerror(errno)); | 239 fprintf(stderr, "Couldn't open /dev/null: %s", strerror(errno)); |
240 exit(1); | 240 exit(1); |
241 } | 241 } |
242 while (++dupfd <= 2) { | 242 while (++dupfd <= 2) { |
243 /* Only clobber closed fds */ | 243 /* Only clobber closed fds */ |