GNU bug report logs -
#19186
[PATCH] OS/2 patches
Previous Next
Reported by: KO Myung-Hun <komh78 <at> gmail.com>
Date: Wed, 26 Nov 2014 02:32:01 UTC
Severity: normal
Tags: patch
Done: Jim Meyering <jim <at> meyering.net>
Bug is archived. No further changes may be made.
Full log
Message #11 received at submit <at> debbugs.gnu.org (full text, mbox):
This fixes the problem that 'diff - file' fails due to seek failure,
because seek does not work on stdin on OS/2 kLIBC.
* src/io.c (sip): Set skip_test to true if seek is not possible on
OS/2 kLIBC.
---
src/io.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/io.c b/src/io.c
index 05a898c..75c39a9 100644
--- a/src/io.c
+++ b/src/io.c
@@ -108,6 +108,11 @@ sip (struct file_data *current, bool skip_test)
PTRDIFF_MAX - 2 * sizeof (word));
current->buffer = xmalloc (current->bufsize);
+#ifdef __KLIBC__
+ /* Skip test if seek is not possible */
+ skip_test = skip_test || lseek (current->desc, 0, SEEK_CUR) < 0;
+#endif
+
if (! skip_test)
{
/* Check first part of file to see if it's a binary file. */
--
1.8.5.2
This bug report was last modified 10 years and 168 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.