components/coreutils/patches/who.c.patch
author Rich Burridge <rich.burridge@oracle.com>
Tue, 03 Mar 2015 16:36:10 -0800
changeset 3900 ac09ed0f6fd4
parent 2050 7c6a1559c620
permissions -rw-r--r--
20640329 /usr/bin/pv should be 64-bit (again).
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2050
7c6a1559c620 PSARC 2014/271 GNU coreutils 8.23
Rich Burridge <rich.burridge@oracle.com>
parents: 584
diff changeset
     1
Needed so that GNU 'who -r' correctly prints the run-level.
7c6a1559c620 PSARC 2014/271 GNU coreutils 8.23
Rich Burridge <rich.burridge@oracle.com>
parents: 584
diff changeset
     2
See CR #15651288 for more details.
7c6a1559c620 PSARC 2014/271 GNU coreutils 8.23
Rich Burridge <rich.burridge@oracle.com>
parents: 584
diff changeset
     3
7c6a1559c620 PSARC 2014/271 GNU coreutils 8.23
Rich Burridge <rich.burridge@oracle.com>
parents: 584
diff changeset
     4
This patch has not been passed upstream yet. It needs to be reworked into
7c6a1559c620 PSARC 2014/271 GNU coreutils 8.23
Rich Burridge <rich.burridge@oracle.com>
parents: 584
diff changeset
     5
a format that would be acceptable.
7c6a1559c620 PSARC 2014/271 GNU coreutils 8.23
Rich Burridge <rich.burridge@oracle.com>
parents: 584
diff changeset
     6
7c6a1559c620 PSARC 2014/271 GNU coreutils 8.23
Rich Burridge <rich.burridge@oracle.com>
parents: 584
diff changeset
     7
--- src/who.c.orig	2014-07-27 14:59:42.573346371 -0700
7c6a1559c620 PSARC 2014/271 GNU coreutils 8.23
Rich Burridge <rich.burridge@oracle.com>
parents: 584
diff changeset
     8
+++ src/who.c	2014-07-27 15:00:16.713849303 -0700
7c6a1559c620 PSARC 2014/271 GNU coreutils 8.23
Rich Burridge <rich.burridge@oracle.com>
parents: 584
diff changeset
     9
@@ -514,8 +514,8 @@
584
f4e402a57670 6962990 GNU 'who -r' does not print run-level
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    10
   unsigned char curr = UT_PID (utmp_ent) % 256;
f4e402a57670 6962990 GNU 'who -r' does not print run-level
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    11
 
f4e402a57670 6962990 GNU 'who -r' does not print run-level
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    12
   if (!runlevline)
f4e402a57670 6962990 GNU 'who -r' does not print run-level
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    13
-    runlevline = xmalloc (strlen (_("run-level")) + 3);
f4e402a57670 6962990 GNU 'who -r' does not print run-level
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    14
-  sprintf (runlevline, "%s %c", _("run-level"), curr);
f4e402a57670 6962990 GNU 'who -r' does not print run-level
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    15
+    runlevline = xmalloc (sizeof (utmp_ent->ut_line));
f4e402a57670 6962990 GNU 'who -r' does not print run-level
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    16
+  sprintf (runlevline, "%s", utmp_ent->ut_line);
f4e402a57670 6962990 GNU 'who -r' does not print run-level
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    17
 
f4e402a57670 6962990 GNU 'who -r' does not print run-level
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    18
   if (!comment)
f4e402a57670 6962990 GNU 'who -r' does not print run-level
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    19
     comment = xmalloc (strlen (_("last=")) + 2);