]> git.proxmox.com Git - qemu.git/commitdiff
bsd-user: OS-agnostic 64-bit SYSCTL types
authorEd Maste <emaste@freebsd.org>
Tue, 30 Apr 2013 13:29:32 +0000 (09:29 -0400)
committerMichael Tokarev <mjt@tls.msk.ru>
Sun, 12 May 2013 09:25:55 +0000 (13:25 +0400)
Use existence of type as #ifdef condition rather than FreeBSD-specific
version check, as suggested by Patrick Welche.

Also handle the signed (CTLTYPE_S64) case identically to the unsigned
(CTLTYPE_U64) case, per later patches in the FreeBSD ports tree
(emulators/qemu-devel/files/patch-z-arm-bsd-user-001).

Signed-off-by: Ed Maste <emaste@freebsd.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
bsd-user/syscall.c

index 69e3466a086f44ce657a64559e16fdea4c678583..a4d1583fedfd73ba330fc4e5f8927d402069647d 100644 (file)
@@ -211,10 +211,11 @@ static int sysctl_oldcvt(void *holdp, size_t holdlen, uint32_t kind)
         *(uint64_t *)holdp = tswap64(*(unsigned long *)holdp);
         break;
 #endif
-#if !defined(__FreeBSD_version) || __FreeBSD_version < 900031
-    case CTLTYPE_QUAD:
-#else
+#ifdef CTLTYPE_U64
+    case CTLTYPE_S64:
     case CTLTYPE_U64:
+#else
+    case CTLTYPE_QUAD:
 #endif
         *(uint64_t *)holdp = tswap64(*(uint64_t *)holdp);
         break;