From b2072011a7998e22f6d8a4f2a815ed3dbab819cc Mon Sep 17 00:00:00 2001
From: Michal Schmidt <mschmidt@redhat.com>
Date: Sun, 6 Nov 2011 23:31:46 +0100
Subject: [PATCH] utmp: initialize store with the found entry, not with the
lookup key (cherry picked from commit
fa4ad7ceca6c96d9f0b7022819acf8954cba35ea)
---
src/utmp-wtmp.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/utmp-wtmp.c b/src/utmp-wtmp.c
index 98c1a25..00e19a3 100644
--- a/src/utmp-wtmp.c
+++ b/src/utmp-wtmp.c
@@ -242,7 +242,7 @@ int utmp_put_dead_process(const char *id, pid_t pid, int code, int status) {
if (found->ut_pid != pid)
return 0;
- memcpy(&store, &lookup, sizeof(store));
+ memcpy(&store, found, sizeof(store));
store.ut_type = DEAD_PROCESS;
store.ut_exit.e_termination = code;
store.ut_exit.e_exit = status;