diff options
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | configure.ac | 10 | ||||
-rw-r--r-- | src/who.c | 2 |
3 files changed, 14 insertions, 5 deletions
@@ -1,3 +1,10 @@ +2006-10-12 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> + + * configure.ac: Avoid compiler warnings about default return + type in function definitions and unused variables in tests. + * src/who.c (print_user) [HAVE_UT_HOST]: hostlen is only needed + if this is #defined. + 2006-10-12 Jim Meyering <jim@meyering.net> * configure.ac: Reflect s/gl_MACROS/coreutils_MACROS/ renaming. diff --git a/configure.ac b/configure.ac index 19020f8ef..c3f8b442d 100644 --- a/configure.ac +++ b/configure.ac @@ -59,14 +59,14 @@ AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <time.h> # include <stdlib.h> #endif extern char **environ; -unset_TZ () +void unset_TZ (void) { char **from, **to; for (to = from = environ; (*to = *from); from++) if (! (to[0][0] == 'T' && to[0][1] == 'Z' && to[0][2] == '=')) to++; } -main() +int main() { time_t now = time ((time_t *) 0); int hour_GMT0, hour_unset; @@ -147,7 +147,7 @@ coreutils_DUMMY_1 AC_MSG_CHECKING(ut_host in struct utmp) AC_CACHE_VAL(su_cv_func_ut_host_in_utmp, [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h> -#include <utmp.h>]], [[struct utmp ut; ut.ut_host;]])], +#include <utmp.h>]], [[struct utmp ut; return !sizeof ut.ut_host;]])], [su_cv_func_ut_host_in_utmp=yes], [su_cv_func_ut_host_in_utmp=no])]) AC_MSG_RESULT($su_cv_func_ut_host_in_utmp) @@ -160,7 +160,7 @@ if test -z "$have_ut_host"; then AC_MSG_CHECKING(ut_host in struct utmpx) AC_CACHE_VAL(su_cv_func_ut_host_in_utmpx, [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h> -#include <utmpx.h>]], [[struct utmpx ut; ut.ut_host;]])], +#include <utmpx.h>]], [[struct utmpx ut; return !sizeof ut.ut_host;]])], [su_cv_func_ut_host_in_utmpx=yes], [su_cv_func_ut_host_in_utmpx=no])]) AC_MSG_RESULT($su_cv_func_ut_host_in_utmpx) @@ -202,7 +202,7 @@ yes #define _XOPEN_SOURCE #endif #include <sys/types.h> -#include <termios.h>]], [[struct termios t; t.c_line;]])], +#include <termios.h>]], [[struct termios t; return !sizeof t.c_line;]])], [su_cv_sys_c_line_in_termios=yes], [su_cv_sys_c_line_in_termios=no])]) AC_MSG_RESULT($su_cv_sys_c_line_in_termios) @@ -320,7 +320,9 @@ print_user (const STRUCT_UTMP *utmp_ent, time_t boottime) char mesg; char idlestr[IDLESTR_LEN + 1]; static char *hoststr; +#if HAVE_UT_HOST static size_t hostlen; +#endif #define DEV_DIR_WITH_TRAILING_SLASH "/dev/" #define DEV_DIR_LEN (sizeof (DEV_DIR_WITH_TRAILING_SLASH) - 1) |