diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2013-01-11 19:08:51 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2013-01-11 19:08:51 +0000 |
commit | 43e22b2b98bacc15438133b5823d545806c8d092 (patch) | |
tree | 2af089980e448cc2cf6ae01d884acb23f26f6d88 /nuttx/libc/misc | |
parent | e7a5090e55f7db78164fda2696af414c3e083806 (diff) | |
download | px4-firmware-43e22b2b98bacc15438133b5823d545806c8d092.tar.gz px4-firmware-43e22b2b98bacc15438133b5823d545806c8d092.tar.bz2 px4-firmware-43e22b2b98bacc15438133b5823d545806c8d092.zip |
Fix an error handling bug in the fread logic
git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5511 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/libc/misc')
-rw-r--r-- | nuttx/libc/misc/lib_filesem.c | 16 | ||||
-rw-r--r-- | nuttx/libc/misc/lib_streamsem.c | 2 |
2 files changed, 8 insertions, 10 deletions
diff --git a/nuttx/libc/misc/lib_filesem.c b/nuttx/libc/misc/lib_filesem.c index 5cc4624ec..f38ff5f23 100644 --- a/nuttx/libc/misc/lib_filesem.c +++ b/nuttx/libc/misc/lib_filesem.c @@ -67,8 +67,8 @@ void lib_sem_initialize(FAR struct file_struct *stream) { - /* Initialize the LIB semaphore to one (to support one-at- - * a-time access to private data sets. + /* Initialize the LIB semaphore to one (to support one-at-a-time access + * to private data sets. */ (void)sem_init(&stream->fs_sem, 0, 1); @@ -98,13 +98,13 @@ void lib_take_semaphore(FAR struct file_struct *stream) /* Take the semaphore (perhaps waiting) */ while (sem_wait(&stream->fs_sem) != 0) - { - /* The only case that an error should occr here is if - * the wait was awakened by a signal. - */ + { + /* The only case that an error should occr here is if the wait + * was awakened by a signal. + */ - ASSERT(get_errno() == EINTR); - } + ASSERT(get_errno() == EINTR); + } /* We have it. Claim the stak and return */ diff --git a/nuttx/libc/misc/lib_streamsem.c b/nuttx/libc/misc/lib_streamsem.c index e38298bdb..3397f9907 100644 --- a/nuttx/libc/misc/lib_streamsem.c +++ b/nuttx/libc/misc/lib_streamsem.c @@ -86,5 +86,3 @@ void stream_semgive(FAR struct streamlist *list) { sem_post(&list->sl_sem); } - - |