work around constant folding bug 61144 in gcc 4.9.0 and 4.9.1
[musl] / src / stdio / ftrylockfile.c
index 725c4c3..56cccaf 100644 (file)
@@ -1,9 +1,10 @@
 #include "stdio_impl.h"
 #include "pthread_impl.h"
+#include <limits.h>
 
 int ftrylockfile(FILE *f)
 {
-       int tid = pthread_self()->tid;
+       int tid = __pthread_self()->tid;
        if (f->lock == tid) {
                if (f->lockcount == LONG_MAX)
                        return -1;