Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b77fe17

Browse files
committed
Use xattr functions from sys/xattr.h instead of attr/xattr.h (closes #12720)
sys/xattr.h is glibc while attr/xattr.h is a separate library.
1 parent 3ac4f59 commit b77fe17

4 files changed

Lines changed: 14 additions & 14 deletions

File tree

Modules/posixmodule.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@ corresponding Unix manual entries for more information on calls.");
107107
#include <sched.h>
108108
#endif
109109

110-
#ifdef HAVE_ATTR_XATTR_H
111-
#include <attr/xattr.h>
110+
#ifdef HAVE_SYS_XATTR_H
111+
#include <sys/xattr.h>
112112
#endif
113113

114114
#if defined(__FreeBSD__) || defined(__DragonFly__) || defined(__APPLE__)
@@ -10032,7 +10032,7 @@ posix_mkfifoat(PyObject *self, PyObject *args)
1003210032
}
1003310033
#endif
1003410034

10035-
#ifdef HAVE_ATTR_XATTR_H
10035+
#ifdef HAVE_SYS_XATTR_H
1003610036

1003710037
static int
1003810038
try_getxattr(const char *path, const char *name,
@@ -10408,7 +10408,7 @@ posix_flistxattr(PyObject *self, PyObject *args)
1040810408
return listxattr_common((const char *)(Py_uintptr_t)fd, wrap_flistxattr);
1040910409
}
1041010410

10411-
#endif /* HAVE_ATTR_XATTR_H */
10411+
#endif /* HAVE_SYS_XATTR_H */
1041210412

1041310413
static PyMethodDef posix_methods[] = {
1041410414
{"access", posix_access, METH_VARARGS, posix_access__doc__},
@@ -10861,7 +10861,7 @@ static PyMethodDef posix_methods[] = {
1086110861
#ifdef HAVE_MKFIFOAT
1086210862
{"mkfifoat", posix_mkfifoat, METH_VARARGS, posix_mkfifoat__doc__},
1086310863
#endif
10864-
#ifdef HAVE_ATTR_XATTR_H
10864+
#ifdef HAVE_SYS_XATTR_H
1086510865
{"setxattr", posix_setxattr, METH_VARARGS, posix_setxattr__doc__},
1086610866
{"lsetxattr", posix_lsetxattr, METH_VARARGS, posix_lsetxattr__doc__},
1086710867
{"fsetxattr", posix_fsetxattr, METH_VARARGS, posix_fsetxattr__doc__},
@@ -11336,7 +11336,7 @@ all_ins(PyObject *d)
1133611336
#endif
1133711337
#endif
1133811338

11339-
#ifdef HAVE_ATTR_XATTR_H
11339+
#ifdef HAVE_SYS_XATTR_H
1134011340
if (ins(d, "XATTR_CREATE", (long)XATTR_CREATE)) return -1;
1134111341
if (ins(d, "XATTR_REPLACE", (long)XATTR_REPLACE)) return -1;
1134211342
if (ins(d, "XATTR_SIZE_MAX", (long)XATTR_SIZE_MAX)) return -1;

configure

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6090,12 +6090,12 @@ $as_echo "#define STDC_HEADERS 1" >>confdefs.h
60906090

60916091
fi
60926092

6093-
for ac_header in asm/types.h attr/xattr.h conio.h curses.h direct.h dlfcn.h errno.h \
6093+
for ac_header in asm/types.h conio.h curses.h direct.h dlfcn.h errno.h \
60946094
fcntl.h grp.h \
60956095
ieeefp.h io.h langinfo.h libintl.h ncurses.h poll.h process.h pthread.h \
60966096
sched.h shadow.h signal.h stdint.h stropts.h termios.h \
60976097
unistd.h utime.h \
6098-
sys/audioio.h sys/bsdtty.h sys/epoll.h sys/event.h sys/file.h sys/loadavg.h \
6098+
sys/audioio.h sys/xattr.h sys/bsdtty.h sys/epoll.h sys/event.h sys/file.h sys/loadavg.h \
60996099
sys/lock.h sys/mkdev.h sys/modem.h \
61006100
sys/param.h sys/poll.h sys/select.h sys/sendfile.h sys/socket.h sys/statvfs.h \
61016101
sys/stat.h sys/termio.h sys/time.h \

configure.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1299,12 +1299,12 @@ dnl AC_MSG_RESULT($cpp_type)
12991299

13001300
# checks for header files
13011301
AC_HEADER_STDC
1302-
AC_CHECK_HEADERS(asm/types.h attr/xattr.h conio.h curses.h direct.h dlfcn.h errno.h \
1302+
AC_CHECK_HEADERS(asm/types.h conio.h curses.h direct.h dlfcn.h errno.h \
13031303
fcntl.h grp.h \
13041304
ieeefp.h io.h langinfo.h libintl.h ncurses.h poll.h process.h pthread.h \
13051305
sched.h shadow.h signal.h stdint.h stropts.h termios.h \
13061306
unistd.h utime.h \
1307-
sys/audioio.h sys/bsdtty.h sys/epoll.h sys/event.h sys/file.h sys/loadavg.h \
1307+
sys/audioio.h sys/xattr.h sys/bsdtty.h sys/epoll.h sys/event.h sys/file.h sys/loadavg.h \
13081308
sys/lock.h sys/mkdev.h sys/modem.h \
13091309
sys/param.h sys/poll.h sys/select.h sys/sendfile.h sys/socket.h sys/statvfs.h \
13101310
sys/stat.h sys/termio.h sys/time.h \

pyconfig.h.in

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,6 @@
6464
/* Define if GCC supports __attribute__((format(PyArg_ParseTuple, 2, 3))) */
6565
#undef HAVE_ATTRIBUTE_FORMAT_PARSETUPLE
6666

67-
/* Define to 1 if you have the <attr/xattr.h> header file. */
68-
#undef HAVE_ATTR_XATTR_H
69-
7067
/* Define to 1 if you have the `bind_textdomain_codeset' function. */
7168
#undef HAVE_BIND_TEXTDOMAIN_CODESET
7269

@@ -948,6 +945,9 @@
948945
/* Define to 1 if you have the <sys/wait.h> header file. */
949946
#undef HAVE_SYS_WAIT_H
950947

948+
/* Define to 1 if you have the <sys/xattr.h> header file. */
949+
#undef HAVE_SYS_XATTR_H
950+
951951
/* Define to 1 if you have the `tcgetpgrp' function. */
952952
#undef HAVE_TCGETPGRP
953953

@@ -1312,7 +1312,7 @@
13121312
this defined. */
13131313
#undef _POSIX_1_SOURCE
13141314

1315-
/* Define to activate features from IEEE Stds 1003.1-2001 */
1315+
/* Define to activate features from IEEE Stds 1003.1-2008 */
13161316
#undef _POSIX_C_SOURCE
13171317

13181318
/* Define to 1 if you need to in order for `stat' and other things to work. */

0 commit comments

Comments
 (0)