summaryrefslogtreecommitdiff
path: root/stdio-common
diff options
context:
space:
mode:
Diffstat (limited to 'stdio-common')
-rw-r--r--stdio-common/psignal.c13
-rw-r--r--stdio-common/vfprintf.c13
2 files changed, 16 insertions, 10 deletions
diff --git a/stdio-common/psignal.c b/stdio-common/psignal.c
index f82bed6933..fc500419fa 100644
--- a/stdio-common/psignal.c
+++ b/stdio-common/psignal.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1992, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1992, 1995, 1996 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
@@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB. If
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
-#include <ansidecl.h>
#include <stdio.h>
#include <signal.h>
@@ -26,24 +25,24 @@ Cambridge, MA 02139, USA. */
#endif
/* Defined in sys_siglist.c. */
-extern CONST char *CONST _sys_siglist[];
+extern const char *const _sys_siglist[];
/* Print out on stderr a line consisting of the test in S, a colon, a space,
a message describing the meaning of the signal number SIG and a newline.
If S is NULL or "", the colon and space are omitted. */
void
-DEFUN(psignal, (sig, s), int sig AND register CONST char *s)
+psignal (int sig, const char *s)
{
- CONST char *colon;
+ const char *colon, *desc;
if (s == NULL || s == '\0')
s = colon = "";
else
colon = ": ";
- if (sig >= 0 && sig < NSIG)
- (void) fprintf (stderr, "%s%s%s\n", s, colon, _(_sys_siglist[sig]));
+ if (sig >= 0 && sig < NSIG && (desc = _sys_siglist[sig]) != NULL)
+ (void) fprintf (stderr, "%s%s%s\n", s, colon, _(desc));
else
(void) fprintf (stderr, _("%s%sUnknown signal %d\n"), s, colon, sig);
}
diff --git a/stdio-common/vfprintf.c b/stdio-common/vfprintf.c
index 44072a4453..82b0e06a31 100644
--- a/stdio-common/vfprintf.c
+++ b/stdio-common/vfprintf.c
@@ -23,7 +23,6 @@ Boston, MA 02111-1307, USA. */
#include <stdlib.h>
#include <errno.h>
#include <wchar.h>
-#include <libc-lock.h>
#include "_itoa.h"
#include "../locale/localeinfo.h"
@@ -124,6 +123,11 @@ ssize_t __wprintf_pad __P ((FILE *, wchar_t pad, size_t n));
} \
while (0)
# define UNBUFFERED_P(s) ((s)->__buffer == NULL)
+
+/* XXX These declarations should go as soon as the stdio header files
+ have these prototypes. */
+extern void __flockfile (FILE *);
+extern void __funlockfile (FILE *);
#endif /* USE_IN_LIBIO */
@@ -152,8 +156,6 @@ ssize_t __wprintf_pad __P ((FILE *, wchar_t pad, size_t n));
# define is_longlong is_long_double
#endif
-extern void __flockfile (FILE *);
-extern void __funlockfile (FILE *);
/* Global variables. */
static const char null[] = "(null)";
@@ -848,8 +850,13 @@ vfprintf (FILE *s, const CHAR_T *format, va_list ap)
f = lead_str_end = find_spec (format, &mbstate);
/* Lock stream. */
+#ifdef USE_IN_LIBIO
+ __libc_cleanup_region_start ((void (*) (void *)) &_IO_funlockfile, s);
+ _IO_flockfile (s);
+#else
__libc_cleanup_region_start ((void (*) (void *)) &__funlockfile, s);
__flockfile (s);
+#endif
/* Write the literal text before the first format. */
outstring ((const UCHAR_T *) format,