[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] DragonFly BSD support - reworked
From: |
Bruno Haible |
Subject: |
Re: [PATCH] DragonFly BSD support - reworked |
Date: |
Sun, 1 Jun 2008 23:22:28 +0200 |
User-agent: |
KMail/1.5.4 |
VOROSKOI Andras wrote:
> diff -aur testdir-stdioext/gllib/stdio-impl.h
> testdir-stdioext-dfly/gllib/stdio-impl.h
> --- testdir-stdioext/gllib/stdio-impl.h 2008-05-01 16:38:47 +0200
> +++ testdir-stdioext-dfly/gllib/stdio-impl.h 2008-06-01 22:52:47 +0200
> @@ -35,7 +35,7 @@
> struct { unsigned char *_base; int _size; } _ub; \
> int _ur; \
> unsigned char _ubuf[3]; \
> - unsigned cahr _nbuf[1]; \
> + unsigned char _nbuf[1]; \
> struct { unsigned char *_base; int _size; } _lb; \
> int _blksize; \
> fpos_t _offset; \
Oops, thanks for this fix.
> Then I got these errors:
> fflush.c:38: error: dereferencing pointer to incomplete type
> fseeko.c:67: error: dereferencing pointer to incomplete type
I applied the attached fix. Thanks.
You find a new tarball at the same place:
http://www.haible.de/bruno/gnu/testdir-stdioext.tar.gz
> File offset is wrong after fseek: 17.
> FAIL: test-fflush
That may be better in the new tarball.
> test-lseek.c:49: assertion failed
> Abort trap (core dumped)
> FAIL: test-lseek.sh
This is clearly a bug in your OS: lseek must fail when at attempt is made
to set a negative file position on a regular file. You can analyze it with
gdb, or extract a simple testcase for your libc + kernel developers.
> Skipping test: file operations failed.
> SKIP: test-freadable
> Skipping test: file operations failed.
> SKIP: test-freading
> Skipping test: file operations failed.
> SKIP: test-fwritable
> Skipping test: file operations failed.
> SKIP: test-fwriting
> testdir-stdioext compiles without that, but the test is
> skipped. Is that normal?
That's not normal. This is also an indication of things gone wrong
in your OS's stdio. You can single-step through it in gdb to see what
went wrong.
Bruno
2008-06-01 Bruno Haible <address@hidden>
* lib/stdio-impl.h (fp_ub): Use fp_. Needed for DragonFly BSD.
Reported by Voroskoi Andras <address@hidden>.
diff --git a/lib/stdio-impl.h b/lib/stdio-impl.h
index 5288162..c803e88 100644
--- a/lib/stdio-impl.h
+++ b/lib/stdio-impl.h
@@ -60,7 +60,7 @@
};
# define fp_ub ((struct __sfileext *) fp->_ext._base)->_ub
# else /* FreeBSD, DragonFly, MacOS X,
Cygwin */
-# define fp_ub fp->_ub
+# define fp_ub fp_->_ub
# endif
# define HASUB(fp) (fp_ub._base != NULL)