Skip to content

fix passwd.h:103:30: warning: passwd_verify with no effect [-Wunused-… #9

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions fsutils/passwd/passwd.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

/****************************************************************************
Expand Down
20 changes: 16 additions & 4 deletions fsutils/passwd/passwd_lock.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 */

Expand All @@ -132,6 +146,4 @@ int passwd_unlock(FAR sem_t *sem)

sem_close(sem);
#endif

return OK;
}