Mercurial > dropbear
comparison cli-session.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 | e8f67918fdc9 |
comparison
equal
deleted
inserted
replaced
1345:1a3c4ec0f840 | 1388:271c57aa3da5 |
---|---|
285 | 285 |
286 if (cli_opts.backgrounded) { | 286 if (cli_opts.backgrounded) { |
287 int devnull; | 287 int devnull; |
288 /* keeping stdin open steals input from the terminal and | 288 /* keeping stdin open steals input from the terminal and |
289 is confusing, though stdout/stderr could be useful. */ | 289 is confusing, though stdout/stderr could be useful. */ |
290 devnull = open(_PATH_DEVNULL, O_RDONLY); | 290 devnull = open(DROPBEAR_PATH_DEVNULL, O_RDONLY); |
291 if (devnull < 0) { | 291 if (devnull < 0) { |
292 dropbear_exit("Opening /dev/null: %d %s", | 292 dropbear_exit("Opening /dev/null: %d %s", |
293 errno, strerror(errno)); | 293 errno, strerror(errno)); |
294 } | 294 } |
295 dup2(devnull, STDIN_FILENO); | 295 dup2(devnull, STDIN_FILENO); |