summaryrefslogtreecommitdiff
path: root/os/src/close.c
diff options
context:
space:
mode:
authorNicolas "Pixel" Noble <pixel@nobis-crew.org>2011-01-29 03:15:44 +0100
committerNicolas "Pixel" Noble <pixel@nobis-crew.org>2011-01-29 03:15:44 +0100
commit499e349afa57536ce80497aa99f61c5492e3733e (patch)
treefe3308c344659e800172cfaad9793918f24ae4b1 /os/src/close.c
parent5754656f65205ff1fd9b23c2a85778b3671caf68 (diff)
More filesystem stuff working. devfs is now in place with stdin, stdout, and stderr.
Diffstat (limited to 'os/src/close.c')
-rw-r--r--os/src/close.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/os/src/close.c b/os/src/close.c
index aa4002b..90b22ed 100644
--- a/os/src/close.c
+++ b/os/src/close.c
@@ -1,7 +1,13 @@
#include <reent.h>
#include <osdebug.h>
+#include <errno.h>
+#include "fio.h"
int _close_r(struct _reent * reent, int fd) {
- DBGOUT("_close_r(%p, %d)\r\n", reent, fd);
- return 0;
+ if (!fio_is_open(fd)) {
+ reent->_errno = EBADF;
+ return -1;
+ }
+
+ return fio_close(fd);
}