Skip to content

Commit 85e129c

Browse files
fix passwd.h:103:30: warning: passwd_verify with no effect [-Wunused-value]
Signed-off-by: Xiang Xiao <[email protected]>
1 parent 7fd1b90 commit 85e129c

File tree

2 files changed

+18
-6
lines changed

2 files changed

+18
-6
lines changed

fsutils/passwd/passwd.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,11 @@ struct passwd_s
9696
#if defined(CONFIG_FS_WRITABLE) && !defined(CONFIG_FSUTILS_PASSWD_READONLY)
9797
# define PASSWD_SEM_DECL(s) FAR sem_t *s
9898
int passwd_lock(FAR sem_t **semp);
99-
int passwd_unlock(FAR sem_t *sem);
99+
void passwd_unlock(FAR sem_t *sem);
100100
#else
101101
# define PASSWD_SEM_DECL(s)
102102
# define passwd_lock(semp) (0)
103-
# define passwd_unlock(sem) (0)
103+
# define passwd_unlock(sem)
104104
#endif
105105

106106
/****************************************************************************

fsutils/passwd/passwd_lock.c

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ static sem_t g_passwd_sem = SEM_INITIALIZER(1);
7171
* Public Functions
7272
****************************************************************************/
7373
/****************************************************************************
74-
* Name: passwd_lock and passwd_unlock
74+
* Name: passwd_lock
7575
*
7676
* Description:
7777
* 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)
121121
return OK;
122122
}
123123

124-
int passwd_unlock(FAR sem_t *sem)
124+
/****************************************************************************
125+
* Name: passwd_unlock
126+
*
127+
* Description:
128+
* Undo the work done by passwd_lock.
129+
*
130+
* Input Parameters:
131+
* sem Pointer to the semaphore
132+
*
133+
* Returned Value:
134+
* None
135+
*
136+
****************************************************************************/
137+
138+
void passwd_unlock(FAR sem_t *sem)
125139
{
126140
/* Release our count on the semaphore */
127141

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

133147
sem_close(sem);
134148
#endif
135-
136-
return OK;
137149
}

0 commit comments

Comments
 (0)