Commit Graph

29 Commits

Author SHA1 Message Date
Paul Eggert
2d0c5eefd0 Sync from gnulib. 2005-09-22 06:05:39 +00:00
Paul Eggert
956daabfc6 (desirable_utmp_entry): Fix bug where "who -b" and "who -r"
failed to give output.
2005-06-22 18:26:22 +00:00
Paul Eggert
ab2edb9e33 Don't use "path" or "filename" to mean "file name"
in comments or local variable names.
2005-06-02 05:05:29 +00:00
Jim Meyering
116e6fb244 Update FSF postal mail address. 2005-05-14 07:58:06 +00:00
Paul Eggert
c315ff58b3 (read_utmp) [!defied UTMP_NAME_FUNCTION]: Add support for options.
Don't assume the file is a regular file.
2005-03-30 07:39:33 +00:00
Paul Eggert
196fb1bc5c (read_utmp): New arg OPTIONS. All uses changed.
Include signal.h, stdbool.h.
(desirable_utmp_entry): New function.
(read_utmp) [defined UTMP_NAME_FUNCTION]: Redo memory allocation
using x2nrealloc, to simplify logic.
(read_utmp) [!defined UTMP_NAME_FUNCTION]: Check for overflow in
size calculation.
2005-03-30 05:18:37 +00:00
Paul Eggert
8f7cca3d72 Include readutmp.h first.
Include <errno.h>, since readutmp.h no longer does that.
2004-11-30 21:39:26 +00:00
Paul Eggert
1cc46fbf53 Sync from gnulib, to remove dependencies of other modules on unlocked-io. 2004-10-04 20:18:43 +00:00
Paul Eggert
838af3f618 (read_utmp): Don't assume that the number of users is less than INT_MAX.
Check for integer overflow in size calculations.
Return -1 (not 1) on failure, since we set errno in that case.
2004-08-02 20:55:14 +00:00
Jim Meyering
33c1c51c49 (extract_trimmed_name): Don't apply strchr to a
non-string; this leads to undefined behavior.
2004-06-12 08:07:30 +00:00
Jim Meyering
cb5f6b9ad3 (read_utmp) [UTMP_NAME_FUNCTION]: Upon realloc failure,
don't leak memory and do call END_UTMP_ENT.
2004-04-19 18:59:52 +00:00
Jim Meyering
26f4d67342 Fix indentation, from gnulib. 2003-10-16 07:58:53 +00:00
Jim Meyering
39468cd38f (read_utmp): Likewise.
Check for fstat error.  Close stream and free storage when failing.
2003-09-17 18:49:34 +00:00
Jim Meyering
1fd5c0ae41 Include <string.h> and <stdlib.h> unconditionally. 2003-04-11 12:21:59 +00:00
Jim Meyering
9def4be367 Remove anachronistic casts of xmalloc, xrealloc, and xcalloc return values. 2003-04-11 12:15:21 +00:00
Jim Meyering
418e181ad8 Don't declare functions declared by xalloc.h.
Include "xalloc.h" instead.
2003-01-10 21:46:37 +00:00
Jim Meyering
3eb2a22131 Include unlocked-io.h. 2001-11-17 13:29:42 +00:00
Jim Meyering
ff9b9b202c Include sys/types.h before sys/stat.h.
Required for ultrix4.3.
2000-04-05 15:00:11 +00:00
Jim Meyering
07730c119b (read_utmp): Guard with `#ifdef UTMP_NAME_FUNCTION',
rather than with `#if HAVE_UTMPNAME'.
2000-02-03 12:20:59 +00:00
Jim Meyering
22cb099f3c (extract_trimmed_name): Use UT_USER instead of hard-coding
uses of ->ut_name.  The latter doesn't work with new Linux header files
where only utmpx.ut_user is declared.
2000-01-30 16:41:25 +00:00
Jim Meyering
9f8bc128f0 (read_utmp): Use the new definitions. 1999-05-05 13:34:18 +00:00
Jim Meyering
4f40ac7422 (read_utmp): Ignore the return value from utmpname. 1999-05-03 02:38:50 +00:00
Jim Meyering
a877f41093 (read_utmp) [HAVE_UTMPNAME]: Rewrite. 1999-03-02 13:53:33 +00:00
Jim Meyering
9b1973fbd7 Include stdio.h. 1999-02-08 03:32:06 +00:00
Jim Meyering
5fd73cbdf3 *** empty log message *** 1999-02-08 00:00:44 +00:00
Jim Meyering
976664803c (read_utmp): Add variant for systems that have the utmpname function.
Ansideclify.
1998-05-16 20:26:54 +00:00
Jim Meyering
8f6f2a4cc1 don't include error.h. 1997-07-13 13:31:30 +00:00
Jim Meyering
708d4a74de (read_utmp): Take new params: count and buffer.
Return boolean indicating failure.
Now, caller must give diagnostic upon.
1997-07-13 03:54:00 +00:00
Jim Meyering
51a0fa60c8 . 1997-07-13 02:54:48 +00:00