fs/vfs and net/socket: fcntl() is not return success fail for F_SETFL. Reported by Jussi Kivilinna.
This commit is contained in:
parent
7fc7cc9f8f
commit
aeb3944f0a
|
@ -1,7 +1,8 @@
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* fs/vfs/fs_fcntl.c
|
* 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>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
@ -153,6 +154,7 @@ int file_vfcntl(FAR struct file *filep, int cmd, va_list ap)
|
||||||
oflags &= FFCNTL;
|
oflags &= FFCNTL;
|
||||||
filep->f_oflags &= ~FFCNTL;
|
filep->f_oflags &= ~FFCNTL;
|
||||||
filep->f_oflags |= oflags;
|
filep->f_oflags |= oflags;
|
||||||
|
ret = OK;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -195,10 +195,13 @@ int net_vfcntl(int sockfd, int cmd, va_list ap)
|
||||||
{
|
{
|
||||||
psock->s_flags &= ~_SF_NONBLOCK;
|
psock->s_flags &= ~_SF_NONBLOCK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ret = OK;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
nerr("ERROR: Non-blocking not supported for this socket\n");
|
nerr("ERROR: Non-blocking not supported for this socket\n");
|
||||||
|
ret = -ENOSYS;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue