diff options
-rw-r--r-- | shell/ash.c | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/shell/ash.c b/shell/ash.c index 59c1d2272..4c9c76b8c 100644 --- a/shell/ash.c +++ b/shell/ash.c | |||
@@ -5701,22 +5701,17 @@ openredirect(union node *redir) | |||
5701 | /* Support for /dev/null */ | 5701 | /* Support for /dev/null */ |
5702 | switch (redir->nfile.type) { | 5702 | switch (redir->nfile.type) { |
5703 | case NFROM: | 5703 | case NFROM: |
5704 | if (!strcmp(fname, "/dev/null")) | ||
5705 | return open("nul",O_RDWR); | ||
5706 | if (!strncmp(fname, "/dev/", 5)) { | ||
5707 | ash_msg("Unhandled device %s\n", fname); | ||
5708 | return -1; | ||
5709 | } | ||
5710 | break; | ||
5711 | |||
5712 | case NFROMTO: | 5704 | case NFROMTO: |
5713 | case NTO: | 5705 | case NTO: |
5706 | #if BASH_REDIR_OUTPUT | ||
5707 | case NTO2: | ||
5708 | #endif | ||
5714 | case NCLOBBER: | 5709 | case NCLOBBER: |
5715 | case NAPPEND: | 5710 | case NAPPEND: |
5716 | if (!strcmp(fname, "/dev/null")) | ||
5717 | return open("nul",O_RDWR); | ||
5718 | if (!strncmp(fname, "/dev/", 5)) { | 5711 | if (!strncmp(fname, "/dev/", 5)) { |
5719 | ash_msg("Unhandled device %s\n", fname); | 5712 | if (!strcmp(fname+5, "null")) |
5713 | return open(fname,O_RDWR); | ||
5714 | ash_msg_and_raise_error("Unhandled device %s\n", fname); | ||
5720 | return -1; | 5715 | return -1; |
5721 | } | 5716 | } |
5722 | break; | 5717 | break; |