aboutsummaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2010-04-14 00:39:09 +0200
committerNguyễn Thái Ngọc Duy <pclouds@gmail.com>2010-04-20 19:14:41 +0200
commit1430ca443d2c8e60dd3d4c579209012d1e347b42 (patch)
treec813c4618fc25a3fef495b084673bb739cc56d2e /shell
parentdd9e50923fa288d47fcf003fc35e318b77137839 (diff)
downloadbusybox-w32-1430ca443d2c8e60dd3d4c579209012d1e347b42.tar.gz
busybox-w32-1430ca443d2c8e60dd3d4c579209012d1e347b42.tar.bz2
busybox-w32-1430ca443d2c8e60dd3d4c579209012d1e347b42.zip
win32: ash: openredirect(): support /dev/null
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Diffstat (limited to 'shell')
-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;