Mercurial > hg > octave-jordi > gnulib-hg
annotate tests/test-fchmod.c @ 17960:1c04e5182252
git-version-gen: revert "detect untagged revisions"
Revert commit bedd7833 as it breaks `make dist` in Inetutils
at least, due to the interdependencies with top/GNUMakefile,
which depend on the tag prefixes. This results in `make dist`
inducing a new call to autoconf where a simple tar-ball build
would be expected.
author | Mats Erik Andersson <mats.andersson@gisladisker.se> |
---|---|
date | Tue, 14 Apr 2015 21:25:59 +0100 |
parents | ab58d4870664 |
children |
rev | line source |
---|---|
15686 | 1 /* Test changing the protections of a file. |
17848 | 2 Copyright (C) 2011-2015 Free Software Foundation, Inc. |
15686 | 3 |
4 This program is free software: you can redistribute it and/or modify | |
5 it under the terms of the GNU General Public License as published by | |
6 the Free Software Foundation; either version 3 of the License, or | |
7 (at your option) any later version. | |
8 | |
9 This program is distributed in the hope that it will be useful, | |
10 but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 GNU General Public License for more details. | |
13 | |
14 You should have received a copy of the GNU General Public License | |
15 along with this program. If not, see <http://www.gnu.org/licenses/>. */ | |
16 | |
17 #include <config.h> | |
18 | |
19 #include <sys/stat.h> | |
20 | |
21 #include "signature.h" | |
22 SIGNATURE_CHECK (fchmod, int, (int, mode_t)); | |
23 | |
24 #include <errno.h> | |
17296
87f819736ab1
Fix typo in previous change, by including <unistd.h>.
Paul Eggert <eggert@cs.ucla.edu>
parents:
17295
diff
changeset
|
25 #include <unistd.h> |
15686 | 26 |
27 #include "macros.h" | |
28 | |
29 int | |
30 main (void) | |
31 { | |
32 /* Test behaviour for invalid file descriptors. */ | |
33 { | |
34 errno = 0; | |
35 ASSERT (fchmod (-1, 0600) == -1); | |
36 ASSERT (errno == EBADF); | |
37 } | |
38 { | |
17295
3a09cc104f4c
tests: don't assume fd 99 is closed
Paul Eggert <eggert@cs.ucla.edu>
parents:
17249
diff
changeset
|
39 close (99); |
15686 | 40 errno = 0; |
41 ASSERT (fchmod (99, 0600) == -1); | |
42 ASSERT (errno == EBADF); | |
43 } | |
44 | |
45 return 0; | |
46 } |