diff --git a/Documentation/NuttxUserGuide.html b/Documentation/NuttxUserGuide.html index 5f1b35ca94..35032cc820 100644 --- a/Documentation/NuttxUserGuide.html +++ b/Documentation/NuttxUserGuide.html @@ -479,14 +479,14 @@ int task_delete(pid_t pid);

Description: This function causes a specified task to cease to exist. - Its stack and TCB will be deallocated. + Its stack and TCB will be deallocated. This function is the companion to task_create(). This is the version of the function exposed to the user; it is simply a wrapper around the internal, task_terminate() function.

The logic in this function only deletes non-running tasks. - If the pid parameter refers to to the currently runing task, then processing is redirected to exit(). + If the pid parameter refers to to the currently runing task, then processing is redirected to exit(). This can only happen if a task calls task_delete() in order to delete itself.

@@ -6223,7 +6223,7 @@ interface of the same name. Description:

The pthread_cancel() function will request that thread be canceled. -The target thread's cancelability state, enabled, or disabled, determines when the cancellation takes effect: When the cancellation is acted on, thread will be terminated. +The target thread's cancelability state, enabled, or disabled, determines when the cancellation takes effect: When the cancellation is acted on, thread will be terminated. When cancelability is disabled, all cancellations are held pending in the target thread until the thread re-enables cancelability.

The target thread's cancelability state determines how the cancellation is acted on: @@ -6592,16 +6592,16 @@ interface of the same name.

@@ -8584,6 +8584,8 @@ int telldir(FAR DIR *dirp);

diff --git a/fs/Kconfig b/fs/Kconfig index 1bd8d5f945..05ab5daea9 100644 --- a/fs/Kconfig +++ b/fs/Kconfig @@ -43,7 +43,7 @@ config DISABLE_PSEUDOFS_OPERATIONS config PSEUDOFS_SOFTLINKS bool "Pseudo-filesystem soft links" default n - depends on !DISABLE_PSEUDOFS_OPERATIONSi && EXPERIMENTAL + depends on !DISABLE_PSEUDOFS_OPERATIONS ---help--- Enable support for soft links in the pseudeo file system. Soft links are not supported within mounted volumes by any NuttX file diff --git a/fs/inode/fs_inodesearch.c b/fs/inode/fs_inodesearch.c index 0fb22b4164..82ebafd8b4 100644 --- a/fs/inode/fs_inodesearch.c +++ b/fs/inode/fs_inodesearch.c @@ -515,6 +515,8 @@ int inode_search(FAR struct inode_search_s *desc) if (desc->linktgt != NULL && INODE_IS_MOUNTPT(node)) { + FAR char *buffer; + /* There would be no problem in this case if the link was to * either to the root directory of the MOUNTPOINT or to a * regular file within the the mounted volume. However, @@ -530,19 +532,28 @@ int inode_search(FAR struct inode_search_s *desc) if (desc->relpath != NULL && *desc->relpath != '\0') { - snprintf(desc->fullpath, PATH_MAX, "%s/%s", - desc->linktgt, desc->relpath); + (void)asprintf(&buffer, "%s/%s", + desc->linktgt, desc->relpath); } else { - strncpy(desc->fullpath, desc->linktgt, PATH_MAX); + buffer = strdup(desc->linktgt); } - /* Reset the search description and perform the search again. */ + if (buffer == NULL) + { + ret = -ENOMEM; + } + else + { + /* Reset the search description and perform the search again. */ - RELEASE_SEARCH(desc); - SETUP_SEARCH(desc, desc->fullpath, false); - ret = _inode_search(desc); + RELEASE_SEARCH(desc); + SETUP_SEARCH(desc, buffer, false); + desc->buffer = buffer; + + ret = _inode_search(desc); + } } } #endif diff --git a/fs/inode/inode.h b/fs/inode/inode.h index 7dbd90e126..4e2f6aa150 100644 --- a/fs/inode/inode.h +++ b/fs/inode/inode.h @@ -48,6 +48,7 @@ #include #include +#include #include /**************************************************************************** @@ -55,6 +56,7 @@ ****************************************************************************/ #ifdef CONFIG_PSEUDOFS_SOFTLINKS + # define SETUP_SEARCH(d,p,n) \ do \ { \ @@ -64,10 +66,20 @@ (d)->parent = NULL; \ (d)->relpath = NULL; \ (d)->linktgt = NULL; \ + (d)->buffer = NULL; \ (d)->nofollow = (n); \ } \ while (0) + +# define RELEASE_SEARCH(d) \ + if ((d)->buffer != NULL) \ + { \ + kmm_free((d)->buffer); \ + (d)->buffer = NULL; \ + } + #else + # define SETUP_SEARCH(d,p,n) \ do \ { \ @@ -78,9 +90,10 @@ (d)->relpath = NULL; \ } \ while (0) -#endif -#define RELEASE_SEARCH(d) +# define RELEASE_SEARCH(d) + +#endif /**************************************************************************** * Public Types @@ -109,9 +122,10 @@ * terminal is a soft link, then return the inode of * the link target. * - OUTPUT: (not used) - * fullpath - INPUT: Not used - * - OUTPUT: May hold an intermediate path which is probably of - * no interest to the caller. + * buffer - INPUT: Not used + * - OUTPUT: May hold an allocated intermediate path which is + * probably of no interest to the caller unless it holds + * the relpath. */ struct inode_search_s @@ -123,8 +137,8 @@ struct inode_search_s FAR const char *relpath; /* Relative path into the mountpoint */ #ifdef CONFIG_PSEUDOFS_SOFTLINKS FAR const char *linktgt; /* Target of symbolic link if linked to a directory */ + FAR char *buffer; /* Path expansion buffer */ bool nofollow; /* true: Don't follow terminal soft link */ - char fullpath[PATH_MAX]; /* Path expansion buffer */ #endif }; diff --git a/fs/semaphore/sem_open.c b/fs/semaphore/sem_open.c index 42d6f96470..847d728594 100644 --- a/fs/semaphore/sem_open.c +++ b/fs/semaphore/sem_open.c @@ -115,9 +115,9 @@ FAR sem_t *sem_open (FAR const char *name, int oflags, ...) /* Make sure that a non-NULL name is supplied */ DEBUGASSERT(name != NULL); - + /* The POSIX specification requires that the "check for the existence - * of a semaphore and the creation of the semaphore if it does not + * of a semaphore and the creation of the semaphore if it does not * exist shall be atomic with respect to other processes executing * sem_open()..." A simple sched_lock() should be sufficient to meet * this requirement.