23 lines
657 B
Plaintext
23 lines
657 B
Plaintext
--- src/cmd/ksh93/bltins/read.c
|
|
+++ src/cmd/ksh93/bltins/read.c 2008-12-17 14:01:01.000000000 +0000
|
|
@@ -263,6 +263,19 @@ int sh_readline(register Shell_t *shp,ch
|
|
delim = ((unsigned)flags)>>D_FLAG;
|
|
if(shp->fdstatus[fd]&IOTTY)
|
|
tty_raw(fd,1);
|
|
+#if defined(__linux__)
|
|
+ else if (flags&N_FLAG)
|
|
+ {
|
|
+ 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
|
|
}
|
|
binary = nv_isattr(np,NV_BINARY);
|
|
if(!binary && !(flags&(N_FLAG|NN_FLAG)))
|