From: Michal Schmidt Date: Sun, 6 Nov 2011 22:31:46 +0000 (+0100) Subject: utmp: initialize store with the found entry, not with the lookup key X-Git-Tag: v38~201 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=fa4ad7ceca6c96d9f0b7022819acf8954cba35ea utmp: initialize store with the found entry, not with the lookup key --- diff --git a/src/utmp-wtmp.c b/src/utmp-wtmp.c index 98c1a25e8..00e19a309 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;