]> granicus.if.org Git - shadow/commitdiff
* libmisc/sulog.c (sulog): The success argument is a bool.
authornekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Mon, 26 May 2008 00:09:24 +0000 (00:09 +0000)
committernekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Mon, 26 May 2008 00:09:24 +0000 (00:09 +0000)
* 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
libmisc/sulog.c

index e65af62f3a9d1247c72e0dc678d4f53a9a8e5e41..d5236148637d3a3028c08ee5e1a7b84a593b453d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2008-05-26  Nicolas François  <nicolas.francois@centraliens.net>
+
+       * 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  <nicolas.francois@centraliens.net>
 
        * libmisc/ttytype.c: Avoid implicit conversion of pointers /
index 05f87650c0bb7a9d94f246f0f294c90a9fa82411..bb1d2a5edb50bd4dc7ef3896d614ea6498bca260 100644 (file)
@@ -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
 #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 */
 }
+