page: fix noseek detection for files like /dev/screen

This commit is contained in:
cinap_lenrek 2011-11-29 13:42:15 -05:00
parent 25f4840c7e
commit 9b6ecc6114

View file

@ -696,7 +696,7 @@ popenfile(Page *p)
p->open = tab[i].open;
if(seek(fd, 0, 0) < 0)
goto Noseek;
if((i = read(fd, buf+n, n)) < 0)
if((i = readn(fd, buf+n, n)) < 0)
goto Err1;
if(i != n || memcmp(buf, buf+n, i)){
n += i;