Age | Commit message (Collapse) | Author |
|
include_heading, include_mesg, include_exit, need_boottime,
need_deadprocs, need_login, need_initspawn, need_clockchange,
need_runlevel, need_users, my_line_only, main): Use bool for booleans.
(print_runlevel): Use unsigned char for bytes.
(list_entries_who, scan_entries, who): Use size_t for sizes.
(main): No need to pass a non-NULL last arg to getopt_long.
|
|
might not be null terminated. All callers changed.
|
|
specifying the most recent boot time. All uses changed.
(idle_string) Consider a line to be "old" if it hasn't been used
since the last boot time. Watch out for overflow when computing
times, and for times in the future.
(idle_string): Record latest boot time.
|
|
has undefined behavior if the year precedes -999 or follows 9999.
Since we have to stop using ctime anyway, we might as well use
strftime and fix the FIXME, and support internationalized dates.
Include "hard-locale.h".
(time_format, time_format_width): New vars.
(time_string, print_line): Use them.
(main): Set them.
(time_string): Use localtime + strftime instead of
ctime, to avoid problems with years before -999 or after 9999.
|
|
too few operands ("missing operand after `xxx'") or
too many operands ("extra operand `xxx'").
Include "quote.h" and/or "error.h" if it wasn't already being included.
|
|
hosts with 64-bit time_t and 32-bit int.
Include "inttostr.h".
(time_string): If ctime fails, print the raw time as an integer
instead of dumping core.
|
|
Problem reported by Guido Leenders in:
http://lists.gnu.org/archive/html/bug-coreutils/2004-06/msg00056.html
|
|
(UT_ID) [!HAVE_STRUCT_XTMP_UT_ID]: Remove bogus comment,
as (sizeof "??") reliably returns 3.
(print_line): Guard against idle and pid being too long
(which is possible when printing headers).
(print_user): Allocate enough bytes for idlestr. Use IDLESTR_LEN.
Avoid unnecessary cast of sizeof to int.
(make_id_equals_comment): Do not assume that UT_ID returns
a string; it might return a non-null-terminated array.
Use strncat instead. It's not very often where strncat is
exactly what you want, but this is one of those rare cases.
|
|
|
|
Remove anachronistic casts.
|
|
|
|
|
|
whether it's leaked or not.
|
|
of 2003-09-19. Now, AUTHORS is a comma-separated list of strings.
Update the call to parse_long_options so that `AUTHORS, NULL' are the
last parameters.
* src/true.c (main): Append NULL to version_etc argument list.
* src/sys2.h (case_GETOPT_VERSION_CHAR): Likewise.
|
|
Begin each WRITTEN_BY string with `Written by ' and end it with `.'.
Mark each WRITTEN_BY string as translatable.
|
|
|
|
the call to parse_long_options so that `AUTHORS, NULL' are the last parameters.
|
|
who's -l option has been eliciting an unconditional warning about
this impending change since sh-utils-2.0.12 (April 2002).
|
|
(print_user): Likewise.
This fixes a typo I introduced in who-users.c on 1996-02-23.
|
|
Don't include closeout.h.
|
|
able to avoid emitting trailing blanks.
|
|
|
|
|
|
|
|
Fix memory allocation arithmetic.
|
|
to avoid warnings about `comparison between signed and unsigned'.
|
|
`exit (1)' to `exit (EXIT_FAILURE)', and
`usage (1)' to `usage (EXIT_FAILURE)'.
|
|
|
|
Now they're defined in readutmp.h.
(print_deadprocs): Remove obsolete FIXME comment.
|
|
|
|
From Karl Eichwalder.
|
|
|
|
width argument) to `int'.
|
|
|
|
It's already included via system.h.
|
|
(print_line): Use "%-8.8s" for the format: the user name is not
always NUL terminated.
(scan_entries) [need_users]: Use IS_USER_PROCESS, so that this works
even on systems without ut_type.
|
|
(NEW_TIME): Define to 0, not INT_MAX.
(UT_PID, UT_ID, UT_EXIT_E_TERMINATION, UT_EXIT_E_EXIT): Define.
Replace literal uses of ut_pid, ut_id, and ut_exit members with
uses through macros.
(make_id_equals_comment): New function, factored out of three others.
|
|
|
|
Use xmalloc everywhere, not malloc.
|
|
instead of hard-coding --help and --version descriptions.
Split --help output into smaller pieces.
Use fputs, not printf.
|
|
`and'.
|
|
Accept new options: --all (-a), --boot (-b), --dead (-d),
--login, --process (-p), --runlevel (-r), --short (-s), --time (-t),
--users (-u).
The -u option now produces POSIX-specified results and is the same as
the long option `--users'. --idle is no longer the same as -u.
(time_string, print_line, print_boottime, print_deadprocs, print_login,
print_initspawn, print_clockchange, print_runlevel): New functions.
(print_user): Renamed from print_entry and reworked.
(search_entries): Remove function.
(who_am_i): Likewise.
(usage): Describe new options.
(main): Handle new options.
Mostly from Michael Stone.
|
|
|
|
(main): Call atexit with close_stdout.
|
|
|
|
prints whatever host information it has, even without --lookup.
|
|
|
|
[long_options]: Add entries for --help and --version.
Remove parse_long_options call.
(main) [getopt switch]: Add a case for each of --help and --version.
|
|
|
|
[long_options]: Remove the "help" and "version" entries.
Remove declarations of show_help and show_version.
(main): Use parse_long_options, including author name(s).
Remove the show_version and show_help blocks.
|