utmp_set(): Fix uninitialized return value

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson
2016-09-13 22:47:16 +02:00
parent 56e94a4e4a
commit 73d462c847
+2 -2
View File
@@ -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 result;
int result = 0;
struct utmp ut;
struct utsname uts;
@@ -72,7 +72,7 @@ int utmp_set(int type, int pid, char *line, char *id, char *user)
if (type != DEAD_PROCESS) {
setutent();
result = pututline(&ut) ? 0 : 1;;
result += pututline(&ut) ? 0 : 1;
endutent();
}
updwtmp(_PATH_WTMP, &ut);