Replace LoaderGetOS() calls by direct calls to uname(3).

In xserver 1.20, LoaderGetOS() is removed. ok and tweak jca@
This commit is contained in:
matthieu 2019-06-30 17:10:24 +00:00
parent 8a3bde648b
commit b61f69c71c
3 changed files with 14 additions and 14 deletions

View File

@ -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)

View File

@ -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)

View File

@ -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)