From 598420a477c172fa9649c847df5a9f18241bd336 Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Fri, 4 Oct 2019 08:49:11 -0600 Subject: [PATCH] fsutils/passwd/passwd_lock.c: Use named semaphore by checking CONFIG_FS_NAMED_SEMAPHORES instead of CONFIG_KERNEL_BUILD. --- fsutils/passwd/passwd_lock.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fsutils/passwd/passwd_lock.c b/fsutils/passwd/passwd_lock.c index c92f7f04e..b06dfb251 100644 --- a/fsutils/passwd/passwd_lock.c +++ b/fsutils/passwd/passwd_lock.c @@ -47,7 +47,7 @@ * Pre-processor Definitions ****************************************************************************/ -#ifdef CONFIG_BUILD_KERNEL +#ifdef CONFIG_FS_NAMED_SEMAPHORES /* In the kernel build mode, we need to use a named semaphore so that all * processes will share the same, named semaphore instance. */ @@ -59,7 +59,7 @@ * Private Data ****************************************************************************/ -#ifndef CONFIG_BUILD_KERNEL +#ifndef CONFIG_FS_NAMED_SEMAPHORES /* In the FLAT and PROTECTED build modes, we do not need to bother with a * named semaphore. We use a single global semaphore in theses cases. */ @@ -92,7 +92,7 @@ int passwd_lock(FAR sem_t **semp) { FAR sem_t *sem; -#ifdef CONFIG_BUILD_KERNEL +#ifdef CONFIG_FS_NAMED_SEMAPHORES /* Open the shared, named semaphore */ sem = sem_open(PASSWD_SEMNAME, O_CREAT, 0644, 1); @@ -127,7 +127,7 @@ int passwd_unlock(FAR sem_t *sem) sem_post(sem); -#ifdef CONFIG_BUILD_KERNEL +#ifdef CONFIG_FS_NAMED_SEMAPHORES /* Close the named semaphore */ (void)sem_close(sem);