diff options
| author | Kevin Cernekee <cernekee@gmail.com> | 2011-07-13 09:30:36 +0200 |
|---|---|---|
| committer | Denys Vlasenko <vda.linux@googlemail.com> | 2011-07-13 09:30:36 +0200 |
| commit | 43a668b2eef5f77d1fe0bee1289cea6649fa793d (patch) | |
| tree | 08196434e6f758e15e77ee6cbf7f82213e926bbd /shell | |
| parent | 064e99646a233240e91f453ba49f6baeab7c2c70 (diff) | |
| download | busybox-w32-43a668b2eef5f77d1fe0bee1289cea6649fa793d.tar.gz busybox-w32-43a668b2eef5f77d1fe0bee1289cea6649fa793d.tar.bz2 busybox-w32-43a668b2eef5f77d1fe0bee1289cea6649fa793d.zip | |
cttyhack: fail gracefully if the device node is missing
Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell')
| -rw-r--r-- | shell/cttyhack.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/shell/cttyhack.c b/shell/cttyhack.c index 522a1ba73..4261289b4 100644 --- a/shell/cttyhack.c +++ b/shell/cttyhack.c | |||
| @@ -146,7 +146,9 @@ int cttyhack_main(int argc UNUSED_PARAM, char **argv) | |||
| 146 | goto ret; | 146 | goto ret; |
| 147 | } while (0); | 147 | } while (0); |
| 148 | 148 | ||
| 149 | fd = xopen(console, O_RDWR); | 149 | fd = open_or_warn(console, O_RDWR); |
| 150 | if (fd < 0) | ||
| 151 | goto ret; | ||
| 150 | //bb_error_msg("switching to '%s'", console); | 152 | //bb_error_msg("switching to '%s'", console); |
| 151 | dup2(fd, 0); | 153 | dup2(fd, 0); |
| 152 | dup2(fd, 1); | 154 | dup2(fd, 1); |
