2008-12-18 15:28:49 +01:00
|
|
|
--- src/cmd/ksh93/bltins/read.c
|
2014-07-08 16:22:03 +02:00
|
|
|
+++ src/cmd/ksh93/bltins/read.c 2014-02-18 12:46:08.326103466 +0000
|
|
|
|
@@ -297,6 +297,20 @@ int sh_readline(register Shell_t *shp,ch
|
2013-02-05 18:51:33 +01:00
|
|
|
ep->e_nttyparm.c_lflag |= ISIG;
|
2014-07-08 16:22:03 +02:00
|
|
|
tty_set(sffileno(iop),TCSADRAIN,&ep->e_nttyparm);
|
2013-02-05 18:51:33 +01:00
|
|
|
}
|
2009-08-06 17:44:17 +02:00
|
|
|
+#if defined(__linux__)
|
2013-02-05 18:51:33 +01:00
|
|
|
+ else if ((shp->fdstatus[fd]&(IOTTY|IONOSEEK))==0)
|
2008-12-18 15:28:49 +01:00
|
|
|
+ {
|
|
|
|
+ struct stat st;
|
|
|
|
+ if ((fstat(fd, &st) == 0) && S_ISFIFO(st.st_mode))
|
|
|
|
+ {
|
|
|
|
+ int fdflg;
|
|
|
|
+ if (((fdflg = fcntl(fd, F_GETFL)) != -1) && !(fdflg & O_NONBLOCK))
|
|
|
|
+ fcntl(fd, F_SETFL, fdflg|O_NONBLOCK);
|
|
|
|
+ shp->fdstatus[fd] |= IONOSEEK;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+#endif
|
2014-07-08 16:22:03 +02:00
|
|
|
+
|
2008-12-18 15:28:49 +01:00
|
|
|
}
|
|
|
|
binary = nv_isattr(np,NV_BINARY);
|
|
|
|
if(!binary && !(flags&(N_FLAG|NN_FLAG)))
|