don't hardcode stdin fileno

This commit is contained in:
Sebastian Ramacher 2010-10-04 09:57:46 +02:00
parent 0818c0c9e3
commit 57f4ae817a

View File

@ -1421,7 +1421,8 @@ open_stdin(gchar* password)
// read from stdin and dump to temporary file
char buffer[BUFSIZ];
ssize_t count = 0;
while ((count = read(0, buffer, BUFSIZ)) > 0)
int stdinfno = fileno(stdin);
while ((count = read(stdinfno, buffer, BUFSIZ)) > 0)
{
if (write(handle, buffer, count) != count)
{