From: Sami Kerola Date: Sat, 17 Aug 2013 18:15:14 +0000 (+0100) Subject: last: make switch cases complete, and inform if impossible occurs X-Git-Tag: v2.24-rc1~339 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5cae90f9d13d89e340a88a428411b2fc1eb29272;p=thirdparty%2Futil-linux.git last: make switch cases complete, and inform if impossible occurs Some of the ut_type numbers does not seem to be recognized by last(1) so they are, at least for now, silently ignored. See glibc documentation for information what the ignored EMPTY, INIT_PROCESS, LOGIN_PROCESS, and ACCOUNTING mean. Reference: FIXME Signed-off-by: Sami Kerola --- diff --git a/login-utils/last.c b/login-utils/last.c index f188092c8e..276d13abd5 100644 --- a/login-utils/last.c +++ b/login-utils/last.c @@ -343,6 +343,8 @@ static int list(struct utmp *p, time_t t, int what) break; case R_NORMAL: break; + default: + abort(); } /* @@ -808,6 +810,15 @@ int main(int argc, char **argv) utmplist = p; break; + case EMPTY: + case INIT_PROCESS: + case LOGIN_PROCESS: + case ACCOUNTING: + /* ignored ut_types */ + break; + + default: + warnx("unrecogized ut_type: %d", ut.ut_type); } /*