diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2020-02-22 12:09:11 -0800 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2020-02-22 12:10:22 -0800 |
commit | dd3ba651b6fae93d4fd1abe4b1632275548197bd (patch) | |
tree | 028e54d518e1275678277e5689cdf6e062c2e71b /tests/test-chownat.c | |
parent | c0a2d3240cc61e13591cff7ef267d80a4bbef001 (diff) | |
download | gnulib-dd3ba651b6fae93d4fd1abe4b1632275548197bd.tar.gz |
chmodat, chownat: new modules
These are split from fchmodat, fchownat. GNU Emacs needs the
POSIX-specified fchmodat, but not the gnulib-specified chmodat and
lchmodat. Split the latter two into a new module chmodat.
Similarly for fchownat. This the same basic idea for why statat
was split from fstatat on 2013-01-23.
* lib/chmodat.c, lib/openat.h (CHMODAT_INLINE):
Rename from FCHMODAT_INLINE. All uses changed.
* lib/chownat.c, lib/openat.h (CHOWNAT_INLINE):
Rename from FCHOWNAT_INLINE. All uses changed.
* lib/openat.h:
(chownat, lchownat): Define if GNULIB_CHOWNAT, not GNULIB_FCHOWNAT.
(chmodat, lchmodat): Define if GNULIB_CHMODAT, not GNULIB_FCHMODAT.
* modules/chmodat, modules/chownat, tests/test-chownat.c: New files.
* modules/fchmodat (Files:): Remove lib/fchmodat.c.
(configure.ac): Remove fchmodat module indicator.
(Makefile.am): Omit chmodat.c.
(Maintainer): Add self.
* modules/fchownat: Similarly, but for chown.
* tests/test-fchownat.c (BASE): Don't define if already defined.
(do_chown, do_lchown) [!TEST_CHOWNAT]: Test fchownat instead.
Diffstat (limited to 'tests/test-chownat.c')
-rw-r--r-- | tests/test-chownat.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/test-chownat.c b/tests/test-chownat.c new file mode 100644 index 0000000000..c58377fcaa --- /dev/null +++ b/tests/test-chownat.c @@ -0,0 +1,27 @@ +/* Tests of chownat and lchownat + Copyright 2020 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <https://www.gnu.org/licenses/>. */ + +#include <config.h> + +#include "openat.h" + +#include "signature.h" +SIGNATURE_CHECK (chownat, int, (int, char const *, uid_t, gid_t)); +SIGNATURE_CHECK (lchownat, int, (int, char const *, uid_t, gid_t)); + +#define BASE "test-chownat.t" +#define TEST_CHOWNAT +#include "test-fchownat.c" |