summaryrefslogtreecommitdiffstats
path: root/shells/bash1/files/patch-error.c
blob: 6d29429fe3399c898773aba245a5329fcb271326 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
--- error.c.orig	Fri Aug 29 12:21:42 2003
+++ error.c	Fri Aug 29 12:24:18 2003
@@ -22,7 +22,7 @@
 #include <fcntl.h>
 
 #if defined (HAVE_VFPRINTF)
-#include <varargs.h>
+#include <stdarg.h>
 #endif
 
 #include <errno.h>
@@ -121,18 +121,15 @@
 #else /* We have VARARGS support, so use it. */
 
 void
-programming_error (va_alist)
-     va_dcl
+programming_error (char *format, ...)
 {
   va_list args;
-  char *format;
 
 #if defined (JOB_CONTROL)
   give_terminal_to (shell_pgrp);
 #endif /* JOB_CONTROL */
 
-  va_start (args);
-  format = va_arg (args, char *);
+  va_start (args, format);
   vfprintf (stderr, format, args);
   fprintf (stderr, "\n");
   va_end (args);
@@ -144,15 +141,12 @@
 }
 
 void
-report_error (va_alist)
-     va_dcl
+report_error (char *format, ...)
 {
   va_list args;
-  char *format;
 
   fprintf (stderr, "%s: ", get_name_for_error ());
-  va_start (args);
-  format = va_arg (args, char *);
+  va_start (args, format);
   vfprintf (stderr, format, args);
   fprintf (stderr, "\n");
 
@@ -162,15 +156,12 @@
 }
 
 void
-fatal_error (va_alist)
-     va_dcl
+fatal_error (char *format, ...)
 {
   va_list args;
-  char *format;
 
   fprintf (stderr, "%s: ", get_name_for_error ());
-  va_start (args);
-  format = va_arg (args, char *);
+  va_start (args, format);
   vfprintf (stderr, format, args);
   fprintf (stderr, "\n");
 
@@ -179,14 +170,12 @@
 }
 
 void
-internal_error (va_alist)
-     va_dcl
+internal_error (char *format, ...)
 {
   va_list args;
-  char *format;
 
   fprintf (stderr, "%s: ", get_name_for_error ());
-  va_start (args);
+  va_start (args, format);
   format = va_arg (args, char *);
   vfprintf (stderr, format, args);
   fprintf (stderr, "\n");
@@ -194,14 +183,12 @@
   va_end (args);
 }
 
-itrace (va_alist)
-     va_dcl
+itrace (char *format, ...)
 {
   va_list args;
-  char *format;
 
   fprintf(stderr, "TRACE: pid %d: ", getpid());
-  va_start (args);
+  va_start (args, format);
   format = va_arg (args, char *);
   vfprintf (stderr, format, args);
   fprintf (stderr, "\n");
OpenPOWER on IntegriCloud