summaryrefslogtreecommitdiff
path: root/src/scandir_posix.c
diff options
context:
space:
mode:
authorAlbrecht Schlosser <albrechts.fltk@online.de>2016-04-16 01:49:15 +0000
committerAlbrecht Schlosser <albrechts.fltk@online.de>2016-04-16 01:49:15 +0000
commitf3a0f4efc3f107c8ede97f07ccc9304bc33b3d08 (patch)
tree3f34781457dc356f67fdc6a953ef3f095ddc9519 /src/scandir_posix.c
parentfea2d9496c49e64091dc161296bce0534a619b89 (diff)
Fix C++ comments in C source files and headers.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11623 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/scandir_posix.c')
-rw-r--r--src/scandir_posix.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/scandir_posix.c b/src/scandir_posix.c
index ec0c84173..5daa7f5e2 100644
--- a/src/scandir_posix.c
+++ b/src/scandir_posix.c
@@ -26,7 +26,7 @@
* The POSIX.1c-1995 extension is required if 'HAVE_PTHREAD' is defined.
*
* Note:
- * In theory, a system that provide threads should also provide 'readdir_r()',
+ * In theory, a system that provides threads should also provide 'readdir_r()',
* a thread-safe version of 'readdir()'. In reality this is not always the case.
* In addition there may be a race condition that can lead to a buffer overflow:
* http://womble.decadent.org.uk/readdir_r-advisory.html
@@ -69,16 +69,16 @@ static pthread_mutex_t scandir_mutex = PTHREAD_MUTEX_INITIALIZER;
/* ========================================================================== */
/*
* This function reads the next entry from the directory referenced by 'dirp',
- * allocate a buffer for the entry and copy it into this buffer.
- * A pointer to this buffer is written to 'entryp' and the size of the buffer is
- * written to 'len'.
+ * allocates a buffer for the entry and copies it into this buffer.
+ * A pointer to this buffer is written to 'entryp' and the size of the buffer
+ * is written to 'len'.
* Success and a NULL pointer is returned for 'entryp' if there are no more
* entries in the directory.
- * On sucess zero is returned and the caller is responsible for 'free()'ing the
- * buffer after use.
+ * On success zero is returned and the caller is responsible for 'free()'ing
+ * the buffer after use.
* On error the return value is nonzero, 'entryp' and 'len' are invalid.
*
- * Should be declared as 'static inline' if the compiler support that.
+ * Should be declared as 'static inline' if the compiler supports that.
*/
static int
readentry(DIR *dirp, struct dirent **entryp, size_t *len)
@@ -89,7 +89,7 @@ readentry(DIR *dirp, struct dirent **entryp, size_t *len)
#ifdef HAVE_PTHREAD
if (!pthread_mutex_lock(&scandir_mutex))
{
- /* Ensure that there is no code path that bypass the '_unlock()' call! */
+ /* Ensure that there is no code path that bypasses the '_unlock()' call! */
#endif /* HAVE_PTHREAD */
errno = 0;
e = readdir(dirp);
@@ -118,7 +118,7 @@ readentry(DIR *dirp, struct dirent **entryp, size_t *len)
}
#ifdef HAVE_PTHREAD
/*
- * In a multithreading environment the systems dirent buffer may be shared
+ * In a multithreading environment the system's dirent buffer may be shared
* between all threads. Therefore the mutex must stay locked until we have
* copied the data to our thread local buffer.
*/
@@ -177,10 +177,10 @@ fl_scandir(const char *dir, struct dirent ***namelist,
}
closedir(dirp);
/*
- * A standard compliant 'closedir()' is allowed to fail with 'EINTR', but
- * the state of the directory structure is undefined in this case.
+ * A standard compliant 'closedir()' is allowed to fail with 'EINTR',
+ * but the state of the directory structure is undefined in this case.
* Therefore we ignore the return value because we can't call 'closedir()'
- * again and must hope that the system has released all ressources.
+ * again and must hope that the system has released all resources.
*/
}
/* Sort entries in array if there is a compare function provided */
@@ -203,7 +203,7 @@ fl_scandir(const char *dir, struct dirent ***namelist,
return result;
}
-#endif // defined(USE_X11) && !defined(HAVE_SCANDIR)
+#endif /* defined(USE_X11) && !defined(HAVE_SCANDIR) */
/*
* End of "$Id$".