summaryrefslogtreecommitdiff
path: root/tests/test-open.h
Commit message (Collapse)AuthorAgeFilesLines
* maint: run 'make update-copyright'Simon Josefsson2023-01-011-1/+1
|
* license: fix GPLv3 texts to use a comma instead of semicolon.Bernhard Voelker2022-01-051-1/+1
| | | | | | | | | See: https://www.gnu.org/licenses/gpl-3.0.html#howto Run: $ git grep -l 'Foundation; either version 3' \ | xargs sed -i '/Foundation; either version 3/ s/n; e/n, e/' * All files using GPLv3: Adjust via the above command.
* maint: run 'make update-copyright'Paul Eggert2022-01-011-1/+1
|
* maint: run 'make update-copyright'Paul Eggert2020-12-311-1/+1
|
* open, openat: Really support O_CLOEXEC.Bruno Haible2020-05-241-0/+20
| | | | | | | | | | | * lib/open.c (open): When have_cloexec is still undecided, do pass a O_CLOEXEC flag to orig_open. * lib/openat.c (rpl_openat): When have_cloexec is still undecided, do pass a O_CLOEXEC flag to orig_openat. * tests/test-open.h (test_open): Verify that O_CLOEXEC is honoured. * modules/open-tests (Depends-on): Add fcntl. * modules/openat-tests (Depends-on): Likewise. * modules/fcntl-safer-tests (Depends-on): Likewise.
* maint: Run 'make update-copyright'Paul Eggert2019-12-311-1/+1
|
* open tests: Enhance test.Bruno Haible2019-09-151-0/+9
| | | | | * tests/test-open.h (test_open): Test the creation of an executable regular file. Also improve initial cleanup.
* maint: Run 'make update-copyright'Paul Eggert2019-01-011-1/+1
|
* maint: Run 'make update-copyright'Paul Eggert2018-01-011-1/+1
|
* all: prefer https: URLsPaul Eggert2017-09-131-1/+1
|
* version-etc: new yearPaul Eggert2017-01-011-1/+1
| | | | | | | | | | * build-aux/gendocs.sh (version): * doc/gendocs_template: * doc/gendocs_template_min: * doc/gnulib.texi: * lib/version-etc.c (COPYRIGHT_YEAR): Update copyright dates by hand in templates and the like. * all files: Run 'make update-copyright'.
* version-etc: new yearPaul Eggert2016-01-011-1/+1
| | | | | | | | | | * build-aux/gendocs.sh (version): * doc/gendocs_template: * doc/gendocs_template_min: * doc/gnulib.texi: * lib/version-etc.c (COPYRIGHT_YEAR): Update copyright dates by hand in templates and the like. * all files: Run 'make update-copyright'.
* version-etc: new yearPaul Eggert2014-12-311-1/+1
| | | | | | * doc/gnulib.texi: * lib/version-etc.c (COPYRIGHT_YEAR): Update copyright date. * all files: Run 'make update-copyright'.
* test-open: port to cygwin, which lacks FortifyEric Blake2014-07-301-3/+5
| | | | | | | | | | | | | | | | | | | | On cygwin, with gcc 4.8.3, I get this compilation warning: In file included from ../../gltests/test-open.c:35:0: ../../gltests/test-open.h:35:1: warning: always_inline function might not be inlinable [-Wattributes] test_open (int (*func) (char const *, int, ...), bool print) ^ On that platform, there are no Fortify enhancements, and the internal macro __always_inline is always defined to turn on the gcc attribute, contrary to our needs. Since relying on a __ prefix is already risky, it's better to limit the workaround of commit d6ba92ea to just glibc. * tests/test-open.h (ALWAYS_INLINE): New macro. (__always_inline): Don't abuse internal symbol on non-glibc. Signed-off-by: Eric Blake <eblake@redhat.com>
* maint: update copyrightEric Blake2014-01-011-1/+1
| | | | | | I ran 'make update-copyright'. Signed-off-by: Eric Blake <eblake@redhat.com>
* open-tests: fix build failure with -Werror=old-style-declarationPádraig Brady2013-12-091-1/+1
| | | | * tests/test-open.h: Reorder the inline to avoid the issue.
* open-tests: port to glibc with _FORTIFY_SOURCE and -O1Paul Eggert2013-12-051-1/+10
| | | | | | | | Problem reported by Daiki Ueno in: http://lists.gnu.org/archive/html/bug-gnulib/2013-06/msg00052.html * tests/test-open.h (__always_inline): New macro, if not already defined. (test_open): Use it.
* maint: update all copyright year number rangesEric Blake2013-01-011-1/+1
| | | | | | Run "make update-copyright". Compare to commit 1602f0a from last year. Signed-off-by: Eric Blake <eblake@redhat.com>
* maint: update all copyright year number rangesJim Meyering2012-01-011-1/+1
| | | | Run "make update-copyright".
* nonblocking: provide O_NONBLOCK for mingwEric Blake2011-04-081-0/+6
| | | | | | | | | | | | | | | | | | | | | | Mingw is the only known platform that lacks O_NONBLOCK (possibly via the alternate spelling O_NDELAY). But mingw also lacks any files where open() needs to enforce non-blocking behavior, and lacks openat(), so it is relatively simple to provide a non-zero flag. A future patches will make use of O_NONBLOCK for pipe2. * modules/nonblocking (Depends-on): Add open. (configure.ac): Set new witness macro. * m4/fcntl_h.m4 (gl_FCNTL_H_DEFAULTS): Provide default for it. * modules/fcntl-h (Makefile.am): Substitute it. * lib/fcntl.in.h (O_NONBLOCK): Guarantee non-zero definition when nonblocking module is in use. * lib/nonblocking.c: Adjust portability test. * lib/open.c (open): Don't let native open see gnulib flag. * tests/test-fcntl-h.c (main): Enhance test. * tests/test-open.h (test_open): Likewise. * doc/posix-headers/fcntl.texi (fcntl.h): Document the replacement. Signed-off-by: Eric Blake <eblake@redhat.com>
* maint: update almost all copyright ranges to include 2011Jim Meyering2011-01-011-1/+1
| | | | Run the new "make update-copyright" rule.
* update nearly all FSF copyright year lists to include 2010Jim Meyering2010-01-011-1/+1
| | | | | Use the same procedure as for 2009, outlined in http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/20081
* open: detect FreeBSD bugEric Blake2009-11-091-27/+29
| | | | | | | | | | | | | | | | | | | | open("link-to-file/", O_RDONLY) mistakenly succeeds. The previous patch was enough to fix utimens when no fd is involved, but this is necessary for futimens to pass. * m4/open.m4 (gl_FUNC_OPEN): Also detect FreeBSD bug with slash on symlink. * doc/posix-functions/open.texi (open): Document the bug. * doc/posix-functions/utimes.texi (utimes): Likewise. * tests/test-open.h (test_open): Add parameters, and test symlink handling. * tests/test-open.c (main): Adjust caller. * tests/test-fcntl-safer.c (main): Likewise. * modules/open-tests (Depends-on): Add stdbool, symlink. * modules/fcntl-safer-tests (Depends-on): Likewise. * tests/test-openat.c (main): Add test-open tests. Signed-off-by: Eric Blake <ebb9@byu.net>
* test-open: support mingw errno valuesEric Blake2009-10-021-3/+4
| | | | | | | | | | | mingw has non-standard errno values for handling directory opens, but they weren't worth working around in the gnulib modules. * tests/test-open.h (test_open): Relax test. * tests/test-fopen.h (test_fopen): Likewise. * tests/test-openat-safer.c (main): Likewise. Signed-off-by: Eric Blake <ebb9@byu.net>
* test-open: on GNU/Hurd, /dev/null is a directoryEric Blake2009-10-021-5/+44
| | | | | | | | | | | | | | | | * tests/test-fopen.h (main): Rename... (test_fopen): ...to this. Use a guaranteed non-directory when confirming open behavior on trailing slash. * tests/test-openat-safer.c (main): Likewise. * tests/test-open.h (main): Likewise.... (test_open): ...to this. * tests/test-fopen.c (main): Adjust caller. * tests/test-fopen-safer.c (main): Likewise. * tests/test-open.c (main): Likewise. * tests/test-fcntl-safer.c (main): Likewise. Reported by Samuel Thibault. Signed-off-by: Eric Blake <ebb9@byu.net>
* test-fcntl-safer: split from test-openEric Blake2009-08-211-0/+45
* tests/test-open.c (main): Move... * tests/test-open.h: ...into new file. * tests/test-fcntl-safer.c: New file. * modules/open-tests (Files): Add test-open.h. * modules/fcntl-safer-tests: New file. Suggested by Bruno Haible. Signed-off-by: Eric Blake <ebb9@byu.net>