bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] ftello: avoid compilation failure with SunStudio c89


From: Eric Blake
Subject: [PATCH] ftello: avoid compilation failure with SunStudio c89
Date: Fri, 31 Dec 2010 11:16:48 -0700

* lib/ftello.c (ftello): Use lseek, not llseek.

Signed-off-by: Eric Blake <address@hidden>
---

I'm pushing this; it fixes:

/opt/sunstudio12.1/bin/c89  -I. -I../../lib   -I/usr/local/include  
-I/usr/local/include -c ../../lib/ftello.c
"../../lib/ftello.c", line 53: argument #2 is incompatible with prototype:
        prototype: union  {double _d, array[2] of int _l} : 
"///usr/include/unistd.h", line 389
        argument : long
"../../lib/ftello.c", line 53: assignment type mismatch:
        long "=" union  {double _d, array[2] of int _l}
c89: acomp failed for ../../lib/ftello.c

(llseek is a non-standard function that uses the older offset_t
union rather than a native 64-bit type, predating off_t).

 ChangeLog    |    3 +++
 lib/ftello.c |    2 +-
 2 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 5eff45b..0821c98 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2010-12-31  Eric Blake  <address@hidden>

+       ftello: avoid compilation failure with SunStudio c89
+       * lib/ftello.c (ftello): Use lseek, not llseek.
+
        tests: avoid failing coreutils tests on cygwin
        * tests/init.sh (find_exe_basenames_): Exempt [.exe.
        (create_exe_shims_): Return 0 when skipping.
diff --git a/lib/ftello.c b/lib/ftello.c
index 098e36a..864ff1c 100644
--- a/lib/ftello.c
+++ b/lib/ftello.c
@@ -50,7 +50,7 @@ ftello (FILE *fp)
       ftello (fp);

       /* Compute the file position ourselves.  */
-      pos = llseek (fileno (fp), (off_t) 0, SEEK_CUR);
+      pos = lseek (fileno (fp), (off_t) 0, SEEK_CUR);
       if (pos >= 0)
         {
           if ((fp_->_flag & _IONBF) == 0 && fp_->_base != NULL)
-- 
1.7.3.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]