mirror of
https://github.com/troglobit/finit.git
synced 2026-11-30 21:18:22 +00:00
utmp_set(): Fix uninitialized return value
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
1 parent
56e94a4e4a
commit
73d462c847
1 file changed
+2
-2
+2
-2
@@ -42,7 +42,7 @@ static void utmp_strncpy(char *dst, const char *src, size_t dlen)
|
|||||||
|
|
||||||
int utmp_set(int type, int pid, char *line, char *id, char *user)
|
int utmp_set(int type, int pid, char *line, char *id, char *user)
|
||||||
{
|
{
|
||||||
int result;
|
int result = 0;
|
||||||
struct utmp ut;
|
struct utmp ut;
|
||||||
struct utsname uts;
|
struct utsname uts;
|
||||||
|
|
||||||
@@ -72,7 +72,7 @@ int utmp_set(int type, int pid, char *line, char *id, char *user)
|
|||||||
|
|
||||||
if (type != DEAD_PROCESS) {
|
if (type != DEAD_PROCESS) {
|
||||||
setutent();
|
setutent();
|
||||||
result = pututline(&ut) ? 0 : 1;;
|
result += pututline(&ut) ? 0 : 1;
|
||||||
endutent();
|
endutent();
|
||||||
}
|
}
|
||||||
updwtmp(_PATH_WTMP, &ut);
|
updwtmp(_PATH_WTMP, &ut);
|
||||||
|
|||||||
Reference in new issue
Block a user