Named semaphores: Bad cast in sem_close(). Fixed by reordering fields of struct nsem_inode_s so that the cast will work

This commit is contained in:
Gregory Nutt 2015-10-23 07:09:25 +08:00
parent 46b688e701
commit 68c4dedb78
1 changed files with 4 additions and 2 deletions

View File

@ -60,10 +60,12 @@
struct inode;
struct nsem_inode_s
{
/* Inode payload unique to named semaphores */
/* Inode payload unique to named semaphores. ns_sem must appear first in
* this structure in order to support casting between type sem_t and
* types of struct nsem_inode_s. */
FAR struct inode *ns_inode; /* Containing inode */
sem_t ns_sem; /* The semaphore */
FAR struct inode *ns_inode; /* Containing inode */
};
#endif