about summary refs log tree commit diff
path: root/nptl/pthread_getattr_default_np.c
diff options
context:
space:
mode:
Diffstat (limited to 'nptl/pthread_getattr_default_np.c')
-rw-r--r--nptl/pthread_getattr_default_np.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/nptl/pthread_getattr_default_np.c b/nptl/pthread_getattr_default_np.c
index cce20cbe94..a9665c5df7 100644
--- a/nptl/pthread_getattr_default_np.c
+++ b/nptl/pthread_getattr_default_np.c
@@ -16,20 +16,14 @@
    License along with the GNU C Library; if not, see
    <https://www.gnu.org/licenses/>.  */
 
-#include <errno.h>
-#include <stdlib.h>
 #include <pthreadP.h>
 
 int
 pthread_getattr_default_np (pthread_attr_t *out)
 {
-  struct pthread_attr *real_out;
-
-  real_out = (struct pthread_attr *) out;
-
   lll_lock (__default_pthread_attr_lock, LLL_PRIVATE);
-  *real_out = __default_pthread_attr;
+  int ret = __pthread_attr_copy (out,
+                                 (pthread_attr_t *) &__default_pthread_attr);
   lll_unlock (__default_pthread_attr_lock, LLL_PRIVATE);
-
-  return 0;
+  return ret;
 }