Mercurial > hg > octave-lojdl > gnulib-hg
annotate tests/test-fcntl-h.c @ 12197:e45d9bb2233e
tests: avoid several compiler warnings
* tests/test-getcwd.c (main): Avoid buffer underflow.
* tests/test-getdate.c (main): String literals are not safe with
putenv, so use setenv. Declare unused argument.
* modules/getdate-tests (Depends-on): Add setenv.
* tests/test-argv-iter.c (main): Declare unused argument. Avoid
problems with string literals in char *.
* tests/test-hash.c (main): Avoid shadowing declaration.
(insert_new): Treat string literals as char const *.
* tests/test-getopt.h (test_getopt): Likewise.
(getopt_loop): Alter types to minimize casting elsewhere.
* tests/test-getopt_long.h (test_getopt_long, getopt_long_loop)
(test_getopt_long_posix): Likewise.
(do_getopt_long): Add wrapper to minimize casting.
* tests/test-atexit.c (clear_temp_file): Use void.
* tests/test-areadlink-with-size.c (main): Declare unused
arguments.
* tests/test-areadlink.c (main): Likewise.
* tests/test-areadlinkat-with-size.c (main): Likewise.
* tests/test-areadlinkat.c (main): Likewise.
* tests/test-canonicalize-lgpl.c (main): Likewise.
* tests/test-canonicalize.c (main): Likewise.
* tests/test-dirent-safer.c (main): Likewise.
* tests/test-dirname.c (main): Likewise.
* tests/test-dup2.c (main): Likewise.
* tests/test-fchdir.c (main): Likewise.
* tests/test-fcntl-h.c (main): Likewise.
* tests/test-fcntl-safer.c (main): Likewise.
* tests/test-fdopendir.c (main): Likewise.
* tests/test-fdutimensat.c (main): Likewise.
* tests/test-fflush.c (main): Likewise.
* tests/test-filenamecat.c (main): Likewise.
* tests/test-filevercmp.c (main): Likewise.
* tests/test-fopen-safer.c (main): Likewise.
* tests/test-fopen.c (main): Likewise.
* tests/test-fpending.c (main): Likewise.
* tests/test-fpurge.c (main): Likewise.
* tests/test-freading.c (main): Likewise.
* tests/test-fstatat.c (main): Likewise.
* tests/test-fsync.c (main): Likewise.
* tests/test-futimens.c (main): Likewise.
* tests/test-getndelim2.c (main): Likewise.
* tests/test-gettimeofday.c (main): Likewise.
* tests/test-getopt.c (main): Likewise.
* tests/test-i-ring.c (main): Likewise.
* tests/test-inttypes.c (main): Likewise.
* tests/test-link.c (main): Likewise.
* tests/test-lstat.c (main): Likewise.
* tests/test-math.c (main): Likewise.
* tests/test-md5.c (main): Likewise.
* tests/test-memchr2.c (main): Likewise.
* tests/test-memrchr.c (main): Likewise.
* tests/test-mkdir.c (main): Likewise.
* tests/test-mkdirat.c (main): Likewise.
* tests/test-mkfifoat.c (main): Likewise.
* tests/test-open.c (main): Likewise.
* tests/test-openat-safer.c (main): Likewise.
* tests/test-openat.c (main): Likewise.
* tests/test-quotearg.c (main): Likewise.
* tests/test-rawmemchr.c (main): Likewise.
* tests/test-readlink.c (main): Likewise.
* tests/test-remove.c (main): Likewise.
* tests/test-rename.c (main): Likewise.
* tests/test-renameat.c (main): Likewise.
* tests/test-rmdir.c (main): Likewise.
* tests/test-sha1.c (main): Likewise.
* tests/test-signal.c (main): Likewise.
* tests/test-sigaction.c (main): Likewise.
* tests/test-stat.c (main): Likewise.
* tests/test-stat-time.c (main): Likewise.
* tests/test-stddef.c (main): Likewise.
* tests/test-stdint.c (main): Likewise.
* tests/test-stdio.c (main): Likewise.
* tests/test-stdlib.c (main): Likewise.
* tests/test-strchrnul.c (main): Likewise.
* tests/test-strerror.c (main): Likewise.
* tests/test-string.c (main): Likewise.
* tests/test-strtod.c (main): Likewise.
* tests/test-strverscmp.c (main): Likewise.
* tests/test-symlink.c (main): Likewise.
* tests/test-symlinkat.c (main): Likewise.
* tests/test-sys_stat.c (main): Likewise.
* tests/test-sys_time.c (main): Likewise.
* tests/test-time.c (main): Likewise.
* tests/test-unistd.c (main): Likewise.
* tests/test-unlink.c (main): Likewise.
* tests/test-unlinkat.c (main): Likewise.
* tests/test-utimens.c (main): Likewise.
* tests/test-utimensat.c (main): Likewise.
* tests/test-version-etc.c (main): Likewise.
* tests/test-wchar.c (main): Likewise.
* tests/test-wctype.c (main): Likewise.
* tests/test-xprintf-posix.c (main): Likewise.
* tests/test-posixtm.c (main): Likewise.
(STREQ): Delete unused macro.
* tests/test-linkat.c (main): Declare unused arguments. Avoid
shadowed variables.
* tests/test-memchr.c (main): Likewise.
Signed-off-by: Eric Blake <ebb9@byu.net>
author | Eric Blake <ebb9@byu.net> |
---|---|
date | Thu, 22 Oct 2009 07:59:46 -0600 |
parents | 18205f9302ac |
children | e8d2c6fc33ad |
rev | line source |
---|---|
11876
cc0527e5d2f4
fcntl-h: rename from fcntl, in preparation for fcntl(2)
Eric Blake <ebb9@byu.net>
parents:
diff
changeset
|
1 /* Test of <fcntl.h> substitute. |
cc0527e5d2f4
fcntl-h: rename from fcntl, in preparation for fcntl(2)
Eric Blake <ebb9@byu.net>
parents:
diff
changeset
|
2 Copyright (C) 2007, 2009 Free Software Foundation, Inc. |
cc0527e5d2f4
fcntl-h: rename from fcntl, in preparation for fcntl(2)
Eric Blake <ebb9@byu.net>
parents:
diff
changeset
|
3 |
cc0527e5d2f4
fcntl-h: rename from fcntl, in preparation for fcntl(2)
Eric Blake <ebb9@byu.net>
parents:
diff
changeset
|
4 This program is free software: you can redistribute it and/or modify |
cc0527e5d2f4
fcntl-h: rename from fcntl, in preparation for fcntl(2)
Eric Blake <ebb9@byu.net>
parents:
diff
changeset
|
5 it under the terms of the GNU General Public License as published by |
cc0527e5d2f4
fcntl-h: rename from fcntl, in preparation for fcntl(2)
Eric Blake <ebb9@byu.net>
parents:
diff
changeset
|
6 the Free Software Foundation; either version 3 of the License, or |
cc0527e5d2f4
fcntl-h: rename from fcntl, in preparation for fcntl(2)
Eric Blake <ebb9@byu.net>
parents:
diff
changeset
|
7 (at your option) any later version. |
cc0527e5d2f4
fcntl-h: rename from fcntl, in preparation for fcntl(2)
Eric Blake <ebb9@byu.net>
parents:
diff
changeset
|
8 |
cc0527e5d2f4
fcntl-h: rename from fcntl, in preparation for fcntl(2)
Eric Blake <ebb9@byu.net>
parents:
diff
changeset
|
9 This program is distributed in the hope that it will be useful, |
cc0527e5d2f4
fcntl-h: rename from fcntl, in preparation for fcntl(2)
Eric Blake <ebb9@byu.net>
parents:
diff
changeset
|
10 but WITHOUT ANY WARRANTY; without even the implied warranty of |
cc0527e5d2f4
fcntl-h: rename from fcntl, in preparation for fcntl(2)
Eric Blake <ebb9@byu.net>
parents:
diff
changeset
|
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
cc0527e5d2f4
fcntl-h: rename from fcntl, in preparation for fcntl(2)
Eric Blake <ebb9@byu.net>
parents:
diff
changeset
|
12 GNU General Public License for more details. |
cc0527e5d2f4
fcntl-h: rename from fcntl, in preparation for fcntl(2)
Eric Blake <ebb9@byu.net>
parents:
diff
changeset
|
13 |
cc0527e5d2f4
fcntl-h: rename from fcntl, in preparation for fcntl(2)
Eric Blake <ebb9@byu.net>
parents:
diff
changeset
|
14 You should have received a copy of the GNU General Public License |
cc0527e5d2f4
fcntl-h: rename from fcntl, in preparation for fcntl(2)
Eric Blake <ebb9@byu.net>
parents:
diff
changeset
|
15 along with this program. If not, see <http://www.gnu.org/licenses/>. */ |
cc0527e5d2f4
fcntl-h: rename from fcntl, in preparation for fcntl(2)
Eric Blake <ebb9@byu.net>
parents:
diff
changeset
|
16 |
cc0527e5d2f4
fcntl-h: rename from fcntl, in preparation for fcntl(2)
Eric Blake <ebb9@byu.net>
parents:
diff
changeset
|
17 /* Written by Bruno Haible <bruno@clisp.org>, 2007. */ |
cc0527e5d2f4
fcntl-h: rename from fcntl, in preparation for fcntl(2)
Eric Blake <ebb9@byu.net>
parents:
diff
changeset
|
18 |
cc0527e5d2f4
fcntl-h: rename from fcntl, in preparation for fcntl(2)
Eric Blake <ebb9@byu.net>
parents:
diff
changeset
|
19 #include <config.h> |
cc0527e5d2f4
fcntl-h: rename from fcntl, in preparation for fcntl(2)
Eric Blake <ebb9@byu.net>
parents:
diff
changeset
|
20 |
cc0527e5d2f4
fcntl-h: rename from fcntl, in preparation for fcntl(2)
Eric Blake <ebb9@byu.net>
parents:
diff
changeset
|
21 #include <fcntl.h> |
cc0527e5d2f4
fcntl-h: rename from fcntl, in preparation for fcntl(2)
Eric Blake <ebb9@byu.net>
parents:
diff
changeset
|
22 |
cc0527e5d2f4
fcntl-h: rename from fcntl, in preparation for fcntl(2)
Eric Blake <ebb9@byu.net>
parents:
diff
changeset
|
23 /* Check that the various O_* macros are defined. */ |
cc0527e5d2f4
fcntl-h: rename from fcntl, in preparation for fcntl(2)
Eric Blake <ebb9@byu.net>
parents:
diff
changeset
|
24 int o = O_DIRECT | O_DIRECTORY | O_DSYNC | O_NDELAY | O_NOATIME | O_NONBLOCK |
11877
18205f9302ac
fcntl-h: add O_TTY_INIT support
Eric Blake <ebb9@byu.net>
parents:
11876
diff
changeset
|
25 | O_NOCTTY | O_NOFOLLOW | O_NOLINKS | O_RSYNC | O_SYNC | O_TTY_INIT |
11876
cc0527e5d2f4
fcntl-h: rename from fcntl, in preparation for fcntl(2)
Eric Blake <ebb9@byu.net>
parents:
diff
changeset
|
26 | O_BINARY | O_TEXT; |
cc0527e5d2f4
fcntl-h: rename from fcntl, in preparation for fcntl(2)
Eric Blake <ebb9@byu.net>
parents:
diff
changeset
|
27 |
cc0527e5d2f4
fcntl-h: rename from fcntl, in preparation for fcntl(2)
Eric Blake <ebb9@byu.net>
parents:
diff
changeset
|
28 /* Check that the various SEEK_* macros are defined. */ |
cc0527e5d2f4
fcntl-h: rename from fcntl, in preparation for fcntl(2)
Eric Blake <ebb9@byu.net>
parents:
diff
changeset
|
29 int sk[] = { SEEK_CUR, SEEK_END, SEEK_SET }; |
cc0527e5d2f4
fcntl-h: rename from fcntl, in preparation for fcntl(2)
Eric Blake <ebb9@byu.net>
parents:
diff
changeset
|
30 |
cc0527e5d2f4
fcntl-h: rename from fcntl, in preparation for fcntl(2)
Eric Blake <ebb9@byu.net>
parents:
diff
changeset
|
31 /* Check that the FD_* macros are defined. */ |
cc0527e5d2f4
fcntl-h: rename from fcntl, in preparation for fcntl(2)
Eric Blake <ebb9@byu.net>
parents:
diff
changeset
|
32 int fd = FD_CLOEXEC; |
cc0527e5d2f4
fcntl-h: rename from fcntl, in preparation for fcntl(2)
Eric Blake <ebb9@byu.net>
parents:
diff
changeset
|
33 |
cc0527e5d2f4
fcntl-h: rename from fcntl, in preparation for fcntl(2)
Eric Blake <ebb9@byu.net>
parents:
diff
changeset
|
34 int |
12197
e45d9bb2233e
tests: avoid several compiler warnings
Eric Blake <ebb9@byu.net>
parents:
11877
diff
changeset
|
35 main (void) |
11876
cc0527e5d2f4
fcntl-h: rename from fcntl, in preparation for fcntl(2)
Eric Blake <ebb9@byu.net>
parents:
diff
changeset
|
36 { |
cc0527e5d2f4
fcntl-h: rename from fcntl, in preparation for fcntl(2)
Eric Blake <ebb9@byu.net>
parents:
diff
changeset
|
37 return 0; |
cc0527e5d2f4
fcntl-h: rename from fcntl, in preparation for fcntl(2)
Eric Blake <ebb9@byu.net>
parents:
diff
changeset
|
38 } |