fix passwd.h:103:30: warning: passwd_verify with no effect [-Wunused-value]

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao 2020-01-09 10:05:50 +08:00 committed by patacongo
parent 7fd1b9065b
commit 573f07f3e4
2 changed files with 18 additions and 6 deletions

View File

@ -96,11 +96,11 @@ struct passwd_s
#if defined(CONFIG_FS_WRITABLE) && !defined(CONFIG_FSUTILS_PASSWD_READONLY)
# define PASSWD_SEM_DECL(s) FAR sem_t *s
int passwd_lock(FAR sem_t **semp);
int passwd_unlock(FAR sem_t *sem);
void passwd_unlock(FAR sem_t *sem);
#else
# define PASSWD_SEM_DECL(s)
# define passwd_lock(semp) (0)
# define passwd_unlock(sem) (0)
# define passwd_unlock(sem)
#endif
/****************************************************************************

View File

@ -71,7 +71,7 @@ static sem_t g_passwd_sem = SEM_INITIALIZER(1);
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: passwd_lock and passwd_unlock
* Name: passwd_lock
*
* Description:
* Lock the /etc/passwd file. This is not a real lock at the level of the
@ -121,7 +121,21 @@ int passwd_lock(FAR sem_t **semp)
return OK;
}
int passwd_unlock(FAR sem_t *sem)
/****************************************************************************
* Name: passwd_unlock
*
* Description:
* Undo the work done by passwd_lock.
*
* Input Parameters:
* sem Pointer to the semaphore
*
* Returned Value:
* None
*
****************************************************************************/
void passwd_unlock(FAR sem_t *sem)
{
/* Release our count on the semaphore */
@ -132,6 +146,4 @@ int passwd_unlock(FAR sem_t *sem)
sem_close(sem);
#endif
return OK;
}