diff options
author | davidovski <david@davidovski.xyz> | 2022-04-17 22:07:52 +0100 |
---|---|---|
committer | davidovski <david@davidovski.xyz> | 2022-04-17 22:07:52 +0100 |
commit | c35d083dc525e223b085ec00e6863ea6eafb003c (patch) | |
tree | 5bbe25b4f92cd1821c8cbbefed9c19de6e42b98e /extra/procps-ng/use_utmpx.patch | |
parent | 7cc715c1249422ddf91987be64a35eef43e3e62d (diff) |
updated musl
Diffstat (limited to 'extra/procps-ng/use_utmpx.patch')
-rw-r--r-- | extra/procps-ng/use_utmpx.patch | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/extra/procps-ng/use_utmpx.patch b/extra/procps-ng/use_utmpx.patch new file mode 100644 index 0000000..ea9e9e2 --- /dev/null +++ b/extra/procps-ng/use_utmpx.patch @@ -0,0 +1,38 @@ +diff -uNr procps-3.3.17.orig/proc/whattime.c procps-3.3.17/proc/whattime.c +--- procps-3.3.17.orig/proc/whattime.c 2021-02-09 04:11:25.000000000 -0600 ++++ procps-3.3.17/proc/whattime.c 2021-03-19 13:40:17.910049032 -0500 +@@ -33,7 +33,7 @@ + #include <fcntl.h> + #include <unistd.h> + #include <time.h> +-#include <utmp.h> ++#include <utmpx.h> + #include <sys/ioctl.h> + #include "whattime.h" + #include "sysinfo.h" +@@ -42,7 +42,7 @@ + static double av[3]; + + char *sprint_uptime(int human_readable) { +- struct utmp *utmpstruct; ++ struct utmpx *utmpstruct; + int upminutes, uphours, updays, upweeks, upyears, updecades; + int pos; + int comma; +@@ -98,13 +98,13 @@ + /* count the number of users */ + + numuser = 0; +- setutent(); +- while ((utmpstruct = getutent())) { ++ setutxent(); ++ while ((utmpstruct = getutxent())) { + if ((utmpstruct->ut_type == USER_PROCESS) && + (utmpstruct->ut_name[0] != '\0')) + numuser++; + } +- endutent(); ++ endutxent(); + + pos += sprintf(buf + pos, "%2d user%s, ", numuser, numuser == 1 ? "" : "s"); + |