From c6364944d4f2aceb3db6c5fea6312ac263b81388 Mon Sep 17 00:00:00 2001 From: nekral-guest Date: Mon, 26 May 2008 00:09:24 +0000 Subject: [PATCH] * libmisc/sulog.c (sulog): The success argument is a bool. * libmisc/sulog.c: The return values of fflush is not checked on purpose. * libmisc/sulog.c: Indicate that some return values should be checked. --- ChangeLog | 8 ++++++++ libmisc/sulog.c | 8 ++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index e65af62f..d5236148 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2008-05-26 Nicolas François + + * libmisc/sulog.c (sulog): The success argument is a bool. + * libmisc/sulog.c: The return values of fflush is not checked on + purpose. + * libmisc/sulog.c: Indicate that some return values should be + checked. + 2008-05-26 Nicolas François * libmisc/ttytype.c: Avoid implicit conversion of pointers / diff --git a/libmisc/sulog.c b/libmisc/sulog.c index 05f87650..bb1d2a5e 100644 --- a/libmisc/sulog.c +++ b/libmisc/sulog.c @@ -2,6 +2,7 @@ * Copyright (c) 1989 - 1992, Julianne Frances Haugh * Copyright (c) 1996 - 2000, Marek Michałkiewicz * Copyright (c) 2001 - 2005, Tomasz Kłoczko + * Copyright (c) 2008 , Nicolas François * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -40,10 +41,11 @@ #include "prototypes.h" #include "defines.h" #include "getdef.h" + /* * sulog - log a SU command execution result */ -void sulog (const char *tty, int success, const char *oldname, const char *name) +void sulog (const char *tty, bool success, const char *oldname, const char *name) { char *sulog_file; time_t now; @@ -93,6 +95,8 @@ void sulog (const char *tty, int success, const char *oldname, const char *name) tm->tm_mon + 1, tm->tm_mday, tm->tm_hour, tm->tm_min, success ? '+' : '-', tty, oldname, name); - fflush (fp); + (void) fflush (fp); fclose (fp); + /* TODO: log if failure */ } +