summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2011-12-08 06:23:58 +0000
committerMike Frysinger <vapier@gentoo.org>2011-12-08 06:23:58 +0000
commit471e020eb9b3c073813e83363faa2a59a5b9e209 (patch)
tree1377bdd711254cb12edc34fb0cbf2bd1b528706e /sys-process/procps/files/procps-3.2.8-time_t.patch
parentAdd patch from upstream for x32 support. (diff)
downloadgentoo-2-471e020eb9b3c073813e83363faa2a59a5b9e209.tar.gz
gentoo-2-471e020eb9b3c073813e83363faa2a59a5b9e209.tar.bz2
gentoo-2-471e020eb9b3c073813e83363faa2a59a5b9e209.zip
Fix ps segfault on x32 ABI.
(Portage version: 2.2.0_alpha79/cvs/Linux x86_64)
Diffstat (limited to 'sys-process/procps/files/procps-3.2.8-time_t.patch')
-rw-r--r--sys-process/procps/files/procps-3.2.8-time_t.patch15
1 files changed, 15 insertions, 0 deletions
diff --git a/sys-process/procps/files/procps-3.2.8-time_t.patch b/sys-process/procps/files/procps-3.2.8-time_t.patch
new file mode 100644
index 000000000000..8053cda924c8
--- /dev/null
+++ b/sys-process/procps/files/procps-3.2.8-time_t.patch
@@ -0,0 +1,15 @@
+seconds_since_1970 is unsigned long, so we can't pass it as time_t or
+we corrupt memory if sizeof(time_t) > sizeof(unsigned long)
+
+--- ps/output.c
++++ ps/output.c
+@@ -989,7 +989,8 @@
+ const char *fmt;
+ int tm_year;
+ int tm_yday;
+- our_time = localtime(&seconds_since_1970); /* not reentrant */
++ time_t sec_1970 = seconds_since_1970;
++ our_time = localtime(&sec_1970); /* not reentrant */
+ tm_year = our_time->tm_year;
+ tm_yday = our_time->tm_yday;
+ t = getbtime() + pp->start_time / Hertz;