Age | Commit message (Collapse) | Author |
|
|
|
S_ISLNK are defined, since they're always defined now.
* src/cp.c (main): Likewise.
* src/ln.c (main): Likewise.
* src/ls.c (get_link_name, make_link_name): Likewise.
* src/mkfifo.c (usage): Likewise.
* src/who.c (S_IWGRP): Likewise.
|
|
|
|
|
|
|
|
|
|
|
|
(main): Check PIDs when invoked with zero or two arguments.
Omit duplicate code in 2-arg case.
(UT_PID): Moved to ../lib/readutmp.h.
|
|
|
|
DEAD_PROCESS, BOOT_TIME, NEW_TIME, UT_TYPE_UNDEF, UT_TYPE): Remove.
(IS_USER_PROCESS): Move to ../lib/readutmp.h.
(UT_TYPE_RUN_LVL, UT_TYPE_INIT_PROCESS, UT_TYPE_LOGIN_PROCESS,
UT_TYPE_DEAD_PROCESS, UT_TYPE_NEW_TIME): New macros.
(gethostname): Remove decl.
(list_entries_who, scan_entries): Use the new macros defined above,
for consistency with pinky, uptime, and users.
|
|
|
|
|
|
|
|
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.
|