From 7c6185ae4bfefb70c17e75219db7269c03c7fd79 Mon Sep 17 00:00:00 2001 From: patacongo Date: Sat, 14 Jul 2012 21:05:40 +0000 Subject: Clean-up files in fs/ directory git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@4942 7fd9a85b-ad96-42d3-883c-3090e2eb8679 --- nuttx/fs/fs_fcntl.c | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) (limited to 'nuttx/fs/fs_fcntl.c') diff --git a/nuttx/fs/fs_fcntl.c b/nuttx/fs/fs_fcntl.c index b7e688895..ff53b0f20 100644 --- a/nuttx/fs/fs_fcntl.c +++ b/nuttx/fs/fs_fcntl.c @@ -53,6 +53,10 @@ * Private Functions ****************************************************************************/ +/**************************************************************************** + * Name: file_vfcntl + ****************************************************************************/ + #if CONFIG_NFILE_DESCRIPTORS > 0 static inline int file_vfcntl(int fildes, int cmd, va_list ap) { @@ -112,8 +116,8 @@ static inline int file_vfcntl(int fildes, int cmd, va_list ap) * successful execution of one of the exec functions. */ - err = ENOSYS; - break; + err = ENOSYS; + break; case F_GETFL: /* Get the file status flags and file access modes, defined in , @@ -158,8 +162,8 @@ static inline int file_vfcntl(int fildes, int cmd, va_list ap) * fildes does not refer to a socket, the results are unspecified. */ - err = EBADF; /* Only valid on socket descriptors */ - break; + err = EBADF; /* Only valid on socket descriptors */ + break; case F_GETLK: /* Get the first lock which blocks the lock description pointed to by the third @@ -188,20 +192,21 @@ static inline int file_vfcntl(int fildes, int cmd, va_list ap) * not be done. */ - err = ENOSYS; /* Not implemented */ - break; + err = ENOSYS; /* Not implemented */ + break; default: - err = EINVAL; - break; - } + err = EINVAL; + break; + } errout: if (err != 0) { - errno = err; + set_errno(err); return ERROR; } + return ret; } #endif /* CONFIG_NFILE_DESCRIPTORS > 0 */ @@ -210,6 +215,10 @@ errout: * Global Functions ****************************************************************************/ +/**************************************************************************** + * Name: fcntl + ****************************************************************************/ + int fcntl(int fildes, int cmd, ...) { va_list ap; -- cgit v1.2.3