bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH]: who -r empty last runlevel + missing informations about som


From: Jim Meyering
Subject: Re: [PATCH]: who -r empty last runlevel + missing informations about some who options in coreutils.texi
Date: Fri, 04 Jul 2008 16:48:38 +0200

Ondřej Vašík <address@hidden> wrote:
> Hello,
> In rhbz #453249 Gian Piero De Lolliis (address@hidden) reported missing last
> runlevel in who -r. Command runlevel displayed last runlevel 'N' - which
> should be displayed as last=S in who -r. Attached patch fixes that issue
> (another possibility could be to not display "last=" at all for this
> case). As this is just a small change I think it doesn't deserve
> mentioning in NEWS.
>
> Additionally I found that there are some options missing in
> coreutils.texi "who" section. I added just the options + basic info from
> help, it would be good to extend it, but this is at least first step.

Thank you for the patches!
I applied the documentation one, after removing some
trailing blanks and making some minor wording changes.

As for the who.c patch, I prefer to omit "last=%c" for
any non-printing byte, so did this:


>From 63467fa18794f02497c7a46e3b7783ba1180f8fc Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Fri, 4 Jul 2008 16:34:39 +0200
Subject: [PATCH] who -r: don't print "last=" when the corresponding byte is 
unprintable

* src/who.c (print_runlevel): Print last=%c only when the "preceding
run-level" byte is printable.  Reported by Gian Piero De Lolliis in
<http://bugzilla.redhat.com/453249>.
---
 src/who.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/who.c b/src/who.c
index 5529618..0bba912 100644
--- a/src/who.c
+++ b/src/who.c
@@ -30,6 +30,7 @@
 #include <sys/types.h>
 #include "system.h"

+#include "c-ctype.h"
 #include "canon-host.h"
 #include "readutmp.h"
 #include "error.h"
@@ -511,7 +512,7 @@ print_runlevel (const STRUCT_UTMP *utmp_ent)
   sprintf (comment, "%s%c", _("last="), (last == 'N') ? 'S' : last);

   print_line (-1, "", ' ', -1, runlevline, time_string (utmp_ent),
-             "", "", comment, "");
+             "", "", c_isprint (last) ? comment : "", "");

   return;
 }
--
1.5.6.1.206.g8dcaf96

>From 5483165b129b1ace218cb20d1a75ddff6ed45488 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Ond=C5=99ej=20Va=C5=A1=C3=ADk?= <address@hidden>
Date: Wed, 2 Jul 2008 14:11:05 +0200
Subject: [PATCH] doc: describe who's -p, -r, and -t options

* doc/coreutils.texi (who invocation):
---
 doc/coreutils.texi |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/doc/coreutils.texi b/doc/coreutils.texi
index 155ba8d..44df6b3 100644
--- a/doc/coreutils.texi
+++ b/doc/coreutils.texi
@@ -12710,6 +12710,24 @@ automatic dial-up internet access.
 @opindex --heading
 Print a line of column headings.

address@hidden -p
address@hidden --process
address@hidden -p
address@hidden --process
+List active processes spawned by init.
+
address@hidden -r
address@hidden --runlevel
address@hidden -r
address@hidden --runlevel
+Print the current (and maybe previous) run-level of the init process.
+
address@hidden -t
address@hidden --time
address@hidden -t
address@hidden --time
+Print last system clock change.
+
 @item -w
 @itemx -T
 @itemx --mesg
--
1.5.6.1.206.g8dcaf96




reply via email to

[Prev in Thread] Current Thread [Next in Thread]