summaryrefslogtreecommitdiff
path: root/os/src/close.c
blob: 5da8b2c8d1b51f14bdb5ac7b2d09b450864169df (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include <reent.h>
#include <errno.h>
#include "fio.h"
#include "osdebug.h"

int _close_r(struct _reent * reent, int fd) {
//    DBGOUT("_close_r(%p, %i)\r\n", reent, fd);
    if (!fio_is_open(fd)) {
        reent->_errno = EBADF;
        return -1;
    }
    
    return fio_close(fd);
}