git.ucc.asn.au
/
tpg
/
acess2.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
847cf52
)
Usermode/libc - Moved perror to errno.c and implimented it properly
author
John Hodge (sonata)
<
[email protected]
>
Mon, 27 May 2013 11:50:17 +0000
(19:50 +0800)
committer
John Hodge (sonata)
<
[email protected]
>
Mon, 27 May 2013 11:50:17 +0000
(19:50 +0800)
Usermode/Libraries/libc.so_src/Makefile
patch
|
blob
|
history
Usermode/Libraries/libc.so_src/errno.c
patch
|
blob
|
history
Usermode/Libraries/libc.so_src/perror.c
[deleted file]
patch
|
blob
|
history
diff --git
a/Usermode/Libraries/libc.so_src/Makefile
b/Usermode/Libraries/libc.so_src/Makefile
index
b7cb1d2
..
2c2e62d
100644
(file)
--- a/
Usermode/Libraries/libc.so_src/Makefile
+++ b/
Usermode/Libraries/libc.so_src/Makefile
@@
-11,7
+11,7
@@
LDFLAGS += -Map map.txt
INCFILES := stdio.h stdlib.h
\r
\r
OBJ = stub.o heap.o stdlib.o env.o stdio.o string.o rand.o
\r
INCFILES := stdio.h stdlib.h
\r
\r
OBJ = stub.o heap.o stdlib.o env.o stdio.o string.o rand.o
\r
-OBJ +=
perror.o
scanf.o signals.o strtoi.o strtof.o
\r
+OBJ += scanf.o signals.o strtoi.o strtof.o
\r
OBJ += printf.o time.o errno.o
\r
OBJ += arch/$(ARCHDIR).ao
\r
# signals.o
\r
OBJ += printf.o time.o errno.o
\r
OBJ += arch/$(ARCHDIR).ao
\r
# signals.o
\r
diff --git
a/Usermode/Libraries/libc.so_src/errno.c
b/Usermode/Libraries/libc.so_src/errno.c
index
9877328
..
b4a4f01
100644
(file)
--- a/
Usermode/Libraries/libc.so_src/errno.c
+++ b/
Usermode/Libraries/libc.so_src/errno.c
@@
-6,6
+6,7
@@
* - errno and strerror
*/
#include "lib.h"
* - errno and strerror
*/
#include "lib.h"
+#include <stdio.h>
#include <errno.h>
#include <acess/sys.h>
#include <errno.h>
#include <acess/sys.h>
@@
-28,3
+29,16
@@
EXPORT const char *strerror(int errnum)
}
}
}
}
+// stdio.h
+EXPORT void perror(const char *s)
+{
+ int err = errno;
+ if( s && s[0] ) {
+ fprintf(stderr, "%s: (%i) %s\n", s, err, strerror(err));
+ }
+ else {
+ fprintf(stderr, "(%i) %s\n", err, strerror(err));
+ }
+ _SysDebug("perror('%s'): %s (%i)", s, strerror(err), err);
+}
+
diff --git
a/Usermode/Libraries/libc.so_src/perror.c
b/Usermode/Libraries/libc.so_src/perror.c
deleted file mode 100644
(file)
index
0431635
..0000000
--- a/
Usermode/Libraries/libc.so_src/perror.c
+++ /dev/null
@@
-1,14
+0,0 @@
-/*
- * Acess2 C Library
- * - By John Hodge (thePowersGang)
- *
- * perror.c
- * - perror() and friends
- */
-#include <errno.h>
-#include <stdio.h>
-
-void perror(const char *s)
-{
- fprintf(stderr, "%s: Error (%i)\n", s, errno);
-}
UCC
git Repository :: git.ucc.asn.au