aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--shell/ash.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/shell/ash.c b/shell/ash.c
index 3380e573e..dcf6fcbcb 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -5044,6 +5044,31 @@ openredirect(union node *redir)
5044 char *fname; 5044 char *fname;
5045 int f; 5045 int f;
5046 5046
5047#if ENABLE_PLATFORM_MINGW32
5048 /* Support for /dev/null */
5049 switch (redir->nfile.type) {
5050 case NFROM:
5051 if (!strcmp(redir->nfile.expfname, "/dev/null"))
5052 return open("nul",O_RDWR);
5053 if (!strncmp(redir->nfile.expfname, "/dev/", 5)) {
5054 ash_msg("Unhandled device %s\n", redir->nfile.expfname);
5055 return -1;
5056 }
5057 break;
5058
5059 case NFROMTO:
5060 case NTO:
5061 case NCLOBBER:
5062 case NAPPEND:
5063 if (!strcmp(redir->nfile.expfname, "/dev/null"))
5064 return open("nul",O_RDWR);
5065 if (!strncmp(redir->nfile.expfname, "/dev/", 5)) {
5066 ash_msg("Unhandled device %s\n", redir->nfile.expfname);
5067 return -1;
5068 }
5069 break;
5070 }
5071#endif
5047 switch (redir->nfile.type) { 5072 switch (redir->nfile.type) {
5048 case NFROM: 5073 case NFROM:
5049 fname = redir->nfile.expfname; 5074 fname = redir->nfile.expfname;