From bb8add1260bbb3a6532ed6ce925434a785cb34ed Mon Sep 17 00:00:00 2001 From: Matthieu Herrb Date: Sun, 30 Jun 2019 17:10:25 +0000 Subject: Replace LoaderGetOS() calls by direct calls to uname(3). In xserver 1.20, LoaderGetOS() is removed. ok and tweak jca@ --- driver/xf86-video-wildcatfb/src/wildcatfb_driver.c | 8 ++++---- driver/xf86-video-wsfb/src/wsfb_driver.c | 10 +++++----- driver/xf86-video-wsudl/src/wsudl_driver.c | 10 +++++----- 3 files changed, 14 insertions(+), 14 deletions(-) (limited to 'driver') 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 #include #include +#include #include /* 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 #include #include +#include #include /* 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 @@ -60,6 +60,7 @@ #include #include #include +#include #include #include #include @@ -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) -- cgit v1.2.3