File tree Expand file tree Collapse file tree 2 files changed +38
-0
lines changed Expand file tree Collapse file tree 2 files changed +38
-0
lines changed Original file line number Diff line number Diff line change @@ -1325,6 +1325,7 @@ $(out)/musl/src/math/llroundl.o: conf-opt := $(conf-opt) -O0
1325
1325
musl += misc/a64l.o
1326
1326
libc += misc/basename.o
1327
1327
musl += misc/dirname.o
1328
+ libc += misc/error.o
1328
1329
libc += misc/ffs.o
1329
1330
musl += misc/get_current_dir_name.o
1330
1331
libc += misc/gethostid.o
Original file line number Diff line number Diff line change
1
+ /*
2
+ * Copyright (C) 2019 Waldemar Kozaczuk
3
+ *
4
+ * This work is open source software, licensed under the terms of the
5
+ * BSD license as described in the LICENSE file in the top-level directory.
6
+ */
7
+
8
+ #include <stdlib.h>
9
+ #include <stdio.h>
10
+ #include <stdarg.h>
11
+ #include <string.h>
12
+
13
+ extern char * program_invocation_name ;
14
+
15
+ void
16
+ error (int status , int errnum , const char * message , ...)
17
+ {
18
+ fflush (stdout );
19
+
20
+ fprintf (stderr , "%s: " , program_invocation_name );
21
+
22
+ va_list args ;
23
+ int ret ;
24
+ va_start (args , message );
25
+ ret = vfprintf (stderr , message , args );
26
+ va_end (args );
27
+
28
+ if (errnum ) {
29
+ fprintf (stderr , ": %s" , strerror (errnum ));
30
+ }
31
+
32
+ fprintf (stderr , "\n" );
33
+
34
+ if (status ) {
35
+ exit (status );
36
+ }
37
+ }
You can’t perform that action at this time.
0 commit comments