Mercurial > gnulib
comparison m4/fchownat.m4 @ 40129:fc1768dc2fc5
fchownat: Fix compilation error on Android 4.3.
* lib/unistd.in.h: Include <sys/stat.h> when module 'fchownat' is in
use.
* m4/fchownat.m4 (gl_FUNC_FCHOWNAT_DEREF_BUG,
gl_FUNC_FCHOWNAT_EMPTY_FILENAME_BUG): Include also <sys/stat.h>.
* doc/posix-functions/fchownat.texi: Mention the issue.
author | Bruno Haible <bruno@clisp.org> |
---|---|
date | Thu, 24 Jan 2019 23:51:11 +0100 |
parents | b06060465f09 |
children |
comparison
equal
deleted
inserted
replaced
40128:a2e861fa78d1 | 40129:fc1768dc2fc5 |
---|---|
1 # fchownat.m4 serial 2 | 1 # fchownat.m4 serial 3 |
2 dnl Copyright (C) 2004-2019 Free Software Foundation, Inc. | 2 dnl Copyright (C) 2004-2019 Free Software Foundation, Inc. |
3 dnl This file is free software; the Free Software Foundation | 3 dnl This file is free software; the Free Software Foundation |
4 dnl gives unlimited permission to copy and/or distribute it, | 4 dnl gives unlimited permission to copy and/or distribute it, |
5 dnl with or without modifications, as long as this notice is preserved. | 5 dnl with or without modifications, as long as this notice is preserved. |
6 | 6 |
54 AC_RUN_IFELSE( | 54 AC_RUN_IFELSE( |
55 [AC_LANG_SOURCE( | 55 [AC_LANG_SOURCE( |
56 [[ | 56 [[ |
57 #include <fcntl.h> | 57 #include <fcntl.h> |
58 #include <unistd.h> | 58 #include <unistd.h> |
59 /* Android 4.3 declares fchownat() in <sys/stat.h> instead. */ | |
60 #include <sys/stat.h> | |
59 #include <stdlib.h> | 61 #include <stdlib.h> |
60 #include <errno.h> | 62 #include <errno.h> |
61 #include <sys/types.h> | 63 #include <sys/types.h> |
62 int | 64 int |
63 main () | 65 main () |
84 [gl_cv_func_fchownat_empty_filename_works], | 86 [gl_cv_func_fchownat_empty_filename_works], |
85 [AC_RUN_IFELSE( | 87 [AC_RUN_IFELSE( |
86 [AC_LANG_PROGRAM( | 88 [AC_LANG_PROGRAM( |
87 [[#include <unistd.h> | 89 [[#include <unistd.h> |
88 #include <fcntl.h> | 90 #include <fcntl.h> |
91 /* Android 4.3 declares fchownat() in <sys/stat.h> instead. */ | |
92 #include <sys/stat.h> | |
89 ]], | 93 ]], |
90 [[int fd; | 94 [[int fd; |
91 int ret; | 95 int ret; |
92 if (mkdir ("conftestdir", 0700) < 0) | 96 if (mkdir ("conftestdir", 0700) < 0) |
93 return 2; | 97 return 2; |