Don't trust st_size of a character device. This fixes using
authorDan Gohman <dan433584@gmail.com>
Tue, 19 Feb 2013 18:57:53 +0000 (18:57 +0000)
committerDan Gohman <dan433584@gmail.com>
Tue, 19 Feb 2013 18:57:53 +0000 (18:57 +0000)
commit22954dbb7e9a8db1225c2ef891ee4905c22e0e00
tree5964f06239bd968e32471804a0e872cbc552e2e8
parent3fa275e6f76a5b7fc24c341a58aa10f8da987e92
Don't trust st_size of a character device. This fixes using
/dev/stdin as an input when stdin is connected to a tty, for example.

No test, because it's difficult to write a reasonably portable test
for this. /dev/stdin isn't a character device when stdin is redirected
from a file or connected to a pipe.

llvm-svn: 175542
llvm/lib/Support/MemoryBuffer.cpp