Skip to content

Commit

Permalink
fs/vfs and net/socket: fcntl() is not return success fail for F_SETFL…
Browse files Browse the repository at this point in the history
…. Reported by Jussi Kivilinna.
  • Loading branch information
gregory-nutt committed Oct 6, 2017
1 parent 7fc7cc9 commit aeb3944
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 3 additions & 1 deletion fs/vfs/fs_fcntl.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
/****************************************************************************
* fs/vfs/fs_fcntl.c
*
* Copyright (C) 2009, 2012-2014, 2016-2017 Gregory Nutt. All rights reserved.
* Copyright (C) 2009, 2012-2014, 2016-2017 Gregory Nutt. All rights
* reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -153,6 +154,7 @@ int file_vfcntl(FAR struct file *filep, int cmd, va_list ap)
oflags &= FFCNTL;
filep->f_oflags &= ~FFCNTL;
filep->f_oflags |= oflags;
ret = OK;
}
break;

Expand Down
3 changes: 3 additions & 0 deletions net/socket/net_vfcntl.c
Original file line number Diff line number Diff line change
Expand Up @@ -195,10 +195,13 @@ int net_vfcntl(int sockfd, int cmd, va_list ap)
{
psock->s_flags &= ~_SF_NONBLOCK;
}

ret = OK;
}
else
{
nerr("ERROR: Non-blocking not supported for this socket\n");
ret = -ENOSYS;
}
}
break;
Expand Down

0 comments on commit aeb3944

Please sign in to comment.