summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@cvs.openbsd.org>2019-06-30 17:10:25 +0000
committerMatthieu Herrb <matthieu@cvs.openbsd.org>2019-06-30 17:10:25 +0000
commitbb8add1260bbb3a6532ed6ce925434a785cb34ed (patch)
treefdf2df692d49c45d55f901959e0dd7b995297eb0
parent8e0001e05fc9a24fc944d4fb07427b53634b52e5 (diff)
Replace LoaderGetOS() calls by direct calls to uname(3).
In xserver 1.20, LoaderGetOS() is removed. ok and tweak jca@
-rw-r--r--driver/xf86-video-wildcatfb/src/wildcatfb_driver.c8
-rw-r--r--driver/xf86-video-wsfb/src/wsfb_driver.c10
-rw-r--r--driver/xf86-video-wsudl/src/wsudl_driver.c10
3 files changed, 14 insertions, 14 deletions
diff --git a/driver/xf86-video-wildcatfb/src/wildcatfb_driver.c b/driver/xf86-video-wildcatfb/src/wildcatfb_driver.c
index b22a28437..4369ef428 100644
--- a/driver/xf86-video-wildcatfb/src/wildcatfb_driver.c
+++ b/driver/xf86-video-wildcatfb/src/wildcatfb_driver.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wildcatfb_driver.c,v 1.12 2014/07/13 16:03:17 matthieu Exp $ */
+/* $OpenBSD: wildcatfb_driver.c,v 1.13 2019/06/30 17:10:24 matthieu Exp $ */
/*
* Copyright (c) 2009 Miodrag Vallat.
@@ -88,6 +88,7 @@
#include <sys/types.h>
#include <sys/mman.h>
#include <sys/time.h>
+#include <sys/utsname.h>
#include <dev/wscons/wsconsio.h>
/* All drivers need this. */
@@ -226,11 +227,10 @@ static pointer
WildcatFBSetup(pointer module, pointer opts, int *errmaj, int *errmin)
{
static Bool setupDone = FALSE;
- const char *osname;
+ struct utsname name;
/* Check that we're being loaded on a OpenBSD system. */
- LoaderGetOS(&osname, NULL, NULL, NULL);
- if (!osname || strcmp(osname, "openbsd") != 0) {
+ if (uname(&name) == -1 || strcmp(name.sysname, "OpenBSD") != 0) {
if (errmaj)
*errmaj = LDR_BADOS;
if (errmin)
diff --git a/driver/xf86-video-wsfb/src/wsfb_driver.c b/driver/xf86-video-wsfb/src/wsfb_driver.c
index f81130664..807557f44 100644
--- a/driver/xf86-video-wsfb/src/wsfb_driver.c
+++ b/driver/xf86-video-wsfb/src/wsfb_driver.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wsfb_driver.c,v 1.36 2014/07/13 15:12:53 matthieu Exp $ */
+/* $OpenBSD: wsfb_driver.c,v 1.37 2019/06/30 17:10:24 matthieu Exp $ */
/*
* Copyright © 2001-2012 Matthieu Herrb
* All rights reserved.
@@ -47,6 +47,7 @@
#include <sys/types.h>
#include <sys/mman.h>
#include <sys/time.h>
+#include <sys/utsname.h>
#include <dev/wscons/wsconsio.h>
/* All drivers need this. */
@@ -201,12 +202,11 @@ static pointer
WsfbSetup(pointer module, pointer opts, int *errmaj, int *errmin)
{
static Bool setupDone = FALSE;
- const char *osname;
+ struct utsname name;
/* Check that we're being loaded on a OpenBSD or NetBSD system. */
- LoaderGetOS(&osname, NULL, NULL, NULL);
- if (!osname || (strcmp(osname, "openbsd") != 0 &&
- strcmp(osname, "netbsd") != 0)) {
+ if (uname(&name) == -1 || (strcmp(name.sysname, "OpenBSD") != 0 &&
+ strcmp(name.sysname, "NetBSD") != 0)) {
if (errmaj)
*errmaj = LDR_BADOS;
if (errmin)
diff --git a/driver/xf86-video-wsudl/src/wsudl_driver.c b/driver/xf86-video-wsudl/src/wsudl_driver.c
index b728f4922..71b2b4e3c 100644
--- a/driver/xf86-video-wsudl/src/wsudl_driver.c
+++ b/driver/xf86-video-wsudl/src/wsudl_driver.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wsudl_driver.c,v 1.11 2014/07/13 15:50:14 matthieu Exp $ */
+/* $OpenBSD: wsudl_driver.c,v 1.12 2019/06/30 17:10:24 matthieu Exp $ */
/*
* Copyright (c) 2009 Marcus Glocker <mglocker@openbsd.org>
@@ -60,6 +60,7 @@
#include <sys/types.h>
#include <sys/mman.h>
#include <sys/time.h>
+#include <sys/utsname.h>
#include <errno.h>
#include <fcntl.h>
#include <unistd.h>
@@ -231,14 +232,13 @@ static pointer
WsudlSetup(pointer module, pointer opts, int *errmaj, int *errmin)
{
static Bool setupDone = FALSE;
- const char *osname;
+ struct utsname name;
DEBUGP("WsudlSetup");
/* Check that we're being loaded on a OpenBSD or NetBSD system. */
- LoaderGetOS(&osname, NULL, NULL, NULL);
- if (osname == NULL || (strcmp(osname, "openbsd") != 0 &&
- strcmp(osname, "netbsd") != 0)) {
+ if (uname(&name) == -1 || (strcmp(name.sysname, "OpenBSD") != 0 &&
+ strcmp(name.sysname, "NetBSD") != 0)) {
if (errmaj)
*errmaj = LDR_BADOS;
if (errmin)