diff options
author | Miles Bader <miles@lsi.nec.co.jp> | 2002-08-16 05:02:02 +0000 |
---|---|---|
committer | Miles Bader <miles@lsi.nec.co.jp> | 2002-08-16 05:02:02 +0000 |
commit | 2d73ea9bd025d716d3ec1cad1bdb5fce49bdd29b (patch) | |
tree | 35250aa6d78ca33d51b9563ba9f3b817c508e118 | |
parent | f106775df14dbd1af2f1e0d3b1b3c67c167f8ce0 (diff) |
(errno): Only define as a macro if __UCLIBC_HAS_THREADS__ is defined.
(__set_errno): Just assign to `errno' (which will be expanded to the
thread-friendly version when appropriate).
-rw-r--r-- | libc/sysdeps/linux/common/bits/errno.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/libc/sysdeps/linux/common/bits/errno.h b/libc/sysdeps/linux/common/bits/errno.h index 97e4320f5..6157d6948 100644 --- a/libc/sysdeps/linux/common/bits/errno.h +++ b/libc/sysdeps/linux/common/bits/errno.h @@ -1,5 +1,5 @@ /* Error constants. Linux specific version. - Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc. + Copyright (C) 1996, 1997, 1998, 1999, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -40,13 +40,14 @@ extern int *__errno_location (void) __THROW __attribute__ ((__const__)); # if defined _LIBC /* We wouldn't need a special macro anymore but it is history. */ -# define __set_errno(val) (*__errno_location ()) = (val) +# define __set_errno(val) ((errno) = (val)) # endif /* _LIBC */ -# if !defined _LIBC || defined __UCLIBC_HAS_THREADS__ +# if defined __UCLIBC_HAS_THREADS__ /* When using threads, errno is a per-thread value. */ # define errno (*__errno_location ()) # endif + # endif /* !__ASSEMBLER__ */ #endif /* _ERRNO_H */ |