-/* Copyright (C) 1991, 1994-2002, 2005, 2008 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1994-2002, 2005, 2008-2010 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
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
- The GNU C Library is distributed in the hope that it will be useful,
+ This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
#ifndef _LIBC
# include <config.h>
/* If nonzero the key allocation failed and we should better use a
static buffer than fail. */
-#define BUFFERSIZ 100
+#define BUFFERSIZ 100
static char local_buf[BUFFERSIZ];
static char *static_buf;
int len;
#ifdef SIGRTMIN
if (signum >= SIGRTMIN && signum <= SIGRTMAX)
- len = __snprintf (buffer, BUFFERSIZ - 1, _("Real-time signal %d"),
- signum - SIGRTMIN);
+ len = __snprintf (buffer, BUFFERSIZ - 1, _("Real-time signal %d"),
+ signum - SIGRTMIN);
else
#endif
- len = __snprintf (buffer, BUFFERSIZ - 1, _("Unknown signal %d"),
- signum);
+ len = __snprintf (buffer, BUFFERSIZ - 1, _("Unknown signal %d"),
+ signum);
if (len >= BUFFERSIZ)
- buffer = NULL;
+ buffer = NULL;
else
- buffer[len] = '\0';
+ buffer[len] = '\0';
return buffer;
}
else
{
/* We don't use the static buffer and so we have a key. Use it
- to get the thread-specific buffer. */
+ to get the thread-specific buffer. */
result = __libc_getspecific (key);
if (result == NULL)
- {
- /* No buffer allocated so far. */
- result = malloc (BUFFERSIZ);
- if (result == NULL)
- /* No more memory available. We use the static buffer. */
- result = local_buf;
- else
- __libc_setspecific (key, result);
- }
+ {
+ /* No buffer allocated so far. */
+ result = malloc (BUFFERSIZ);
+ if (result == NULL)
+ /* No more memory available. We use the static buffer. */
+ result = local_buf;
+ else
+ __libc_setspecific (key, result);
+ }
}
return result;