Source-Changes-HG archive

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

[src/trunk]: src/lib/libc/stdio Don't try to extend the offset range on 32 bi...



details:   https://anonhg.NetBSD.org/src/rev/d6fdc1363ac2
branches:  trunk
changeset: 803933:d6fdc1363ac2
user:      christos <christos%NetBSD.org@localhost>
date:      Sun Nov 16 20:32:52 2014 +0000

description:
Don't try to extend the offset range on 32 bit machines by treating negative
offsets as positive. It is just confusing.

diffstat:

 lib/libc/stdio/fseek.c |  7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diffs (31 lines):

diff -r 492f25ef0e39 -r d6fdc1363ac2 lib/libc/stdio/fseek.c
--- a/lib/libc/stdio/fseek.c    Sun Nov 16 18:54:52 2014 +0000
+++ b/lib/libc/stdio/fseek.c    Sun Nov 16 20:32:52 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fseek.c,v 1.23 2008/04/29 06:53:01 martin Exp $        */
+/*     $NetBSD: fseek.c,v 1.24 2014/11/16 20:32:52 christos Exp $      */
 
 /*-
  * Copyright (c) 2005 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include <sys/cdefs.h>
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: fseek.c,v 1.23 2008/04/29 06:53:01 martin Exp $");
+__RCSID("$NetBSD: fseek.c,v 1.24 2014/11/16 20:32:52 christos Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include <sys/types.h>
@@ -55,9 +55,12 @@
 {
        off_t offset;
 
+#if 0
+       /* This is a bad idea because makes fseek(fp, -6, SEEK_SET) work... */
        if (whence == SEEK_SET)
                offset = (unsigned long)l_offset;
        else
+#endif
                offset = l_offset;
        return fseeko(fp, offset, whence);
 }



Home | Main Index | Thread Index | Old Index