about summary refs log tree commit diff
path: root/misc/tst-gethostid.c
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2020-01-30 15:54:49 +0100
committerFlorian Weimer <fweimer@redhat.com>2020-01-30 15:54:49 +0100
commit9baa46aa7b1aa56c8fb313013bb9aecf4ed96504 (patch)
tree795d2244b683dc9e8c027146a239951542d01d7d /misc/tst-gethostid.c
parent352bb99754ae7c83ff1b974f9c52244e974c9410 (diff)
downloadglibc-9baa46aa7b1aa56c8fb313013bb9aecf4ed96504.tar.gz
glibc-9baa46aa7b1aa56c8fb313013bb9aecf4ed96504.tar.xz
glibc-9baa46aa7b1aa56c8fb313013bb9aecf4ed96504.zip
nptl: Avoid using PTHREAD_MUTEX_DEFAULT in macro definition [BZ #25271]
Commit 1c3f9acf1f1f75faa7a28bf39af64afd ("nptl: Add struct_mutex.h")
replaced a zero constant with the identifier PTHREAD_MUTEX_DEFAULT
in the macro PTHREAD_MUTEX_INITIALIZER.  However, that constant
is not available in ISO C11 mode:

In file included from /usr/include/bits/thread-shared-types.h:74,
                 from /usr/include/bits/pthreadtypes.h:23,
                 from /usr/include/pthread.h:26,
                 from bug25271.c:1:
bug25271.c:3:21: error: ‘PTHREAD_MUTEX_DEFAULT’ undeclared here (not in a function)
    3 | pthread_mutex_t m = PTHREAD_MUTEX_INITIALIZER;
      |                     ^~~~~~~~~~~~~~~~~~~~~~~~~

This commit change the constant to the equivalent
PTHREAD_MUTEX_TIMED_NP, which is in the POSIX extension namespace
and thus always available.
Diffstat (limited to 'misc/tst-gethostid.c')
0 files changed, 0 insertions, 0 deletions