summaryrefslogtreecommitdiff
path: root/emulators/qemu-devel/files
diff options
context:
space:
mode:
authorJuergen Lock <nox@FreeBSD.org>2014-11-29 15:19:08 +0000
committerJuergen Lock <nox@FreeBSD.org>2014-11-29 15:19:08 +0000
commit479b4da944fe378b731c61b764668b2f85973e46 (patch)
treed57d16cbaf01b49ac6b8a7cd2dc9e7652c71cbce /emulators/qemu-devel/files
parentConvert pygtk2 run-dependency to USE_GNOME=pygtk2 (diff)
- bsd-user: fix hw.machine and hw.machine_arch sysctls for a NULL buffer.
- Bump PORTREVISION. Submitted by: sson Obtained from: https://github.com/seanbruno/qemu-bsd-user/commit/8267ad2cb92b106bb16e91234f04abc49ab32036
Notes
Notes: svn path=/head/; revision=373627
Diffstat (limited to 'emulators/qemu-devel/files')
-rw-r--r--emulators/qemu-devel/files/extra-patch-8267ad2cb92b106bb16e91234f04abc49ab3203633
1 files changed, 33 insertions, 0 deletions
diff --git a/emulators/qemu-devel/files/extra-patch-8267ad2cb92b106bb16e91234f04abc49ab32036 b/emulators/qemu-devel/files/extra-patch-8267ad2cb92b106bb16e91234f04abc49ab32036
new file mode 100644
index 000000000000..ea3a4b5143ba
--- /dev/null
+++ b/emulators/qemu-devel/files/extra-patch-8267ad2cb92b106bb16e91234f04abc49ab32036
@@ -0,0 +1,33 @@
+From 8267ad2cb92b106bb16e91234f04abc49ab32036 Mon Sep 17 00:00:00 2001
+From: Stacey Son <sson@FreeBSD.org>
+Date: Wed, 26 Nov 2014 21:07:00 +0000
+Subject: [PATCH] Bug fix for hw.machine and hw.machine_arch sysctl's.
+
+For a NULL buffer sysctl needs to return just the length of the buffer.
+---
+ bsd-user/freebsd/os-sys.c | 8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/bsd-user/freebsd/os-sys.c b/bsd-user/freebsd/os-sys.c
+index 3ab4f8e..dbdc9ef 100644
+--- a/bsd-user/freebsd/os-sys.c
++++ b/bsd-user/freebsd/os-sys.c
+@@ -336,12 +336,16 @@ abi_long do_freebsd_sysctl(CPUArchState *env, abi_ulong namep, int32_t namelen,
+ case CTL_HW:
+ switch (snamep[1]) {
+ case HW_MACHINE:
+- strlcpy(holdp, TARGET_HW_MACHINE, oldlen);
++ holdlen = sizeof(TARGET_HW_MACHINE);
++ if (holdp)
++ strlcpy(holdp, TARGET_HW_MACHINE, oldlen);
+ ret = 0;
+ goto out;
+
+ case HW_MACHINE_ARCH:
+- strlcpy(holdp, TARGET_HW_MACHINE_ARCH, oldlen);
++ holdlen = sizeof(TARGET_HW_MACHINE_ARCH);
++ if (holdp)
++ strlcpy(holdp, TARGET_HW_MACHINE_ARCH, oldlen);
+ ret = 0;
+ goto out;
+