From owner-svn-src-head@freebsd.org Wed Mar 1 02:07:52 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A08A4CF235A; Wed, 1 Mar 2017 02:07:52 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 44F978D8; Wed, 1 Mar 2017 02:07:52 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2127pIc062833; Wed, 1 Mar 2017 02:07:51 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2127pcv062832; Wed, 1 Mar 2017 02:07:51 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201703010207.v2127pcv062832@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 1 Mar 2017 02:07:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r314448 - head/sys/libkern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Mar 2017 02:07:52 -0000 Author: imp Date: Wed Mar 1 02:07:51 2017 New Revision: 314448 URL: https://svnweb.freebsd.org/changeset/base/314448 Log: strstr.c was inadvertently blasted with a copy of isa_nmi.c. Revert and remove clause 3 while I'm here. Modified: head/sys/libkern/strstr.c Modified: head/sys/libkern/strstr.c ============================================================================== --- head/sys/libkern/strstr.c Wed Mar 1 01:45:52 2017 (r314447) +++ head/sys/libkern/strstr.c Wed Mar 1 02:07:51 2017 (r314448) @@ -1,9 +1,9 @@ /*- - * Copyright (c) 1991 The Regents of the University of California. - * All rights reserved. + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. * * This code is derived from software contributed to Berkeley by - * William Jolitz. + * Chris Torek. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -28,42 +28,32 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * from: @(#)isa.c 7.2 (Berkeley) 5/13/91 */ #include __FBSDID("$FreeBSD$"); -#include -#include -#include - -#include - -#define NMI_PARITY 0x04 -#define NMI_EPARITY 0x02 +#include +#include /* - * Handle a NMI, possibly a machine check. - * return true to panic system, false to ignore. + * Find the first occurrence of find in s. */ -int -isa_nmi(int cd) +char * +strstr(const char *s, const char *find) { - int retval = 0; - int port = inb(0x33); + char c, sc; + size_t len; - log(LOG_CRIT, "NMI PC98 port = %x\n", port); - if (port & NMI_PARITY) { - log(LOG_CRIT, "BASE RAM parity error, likely hardware failure."); - retval = 1; - } else if (port & NMI_EPARITY) { - log(LOG_CRIT, "EXTENDED RAM parity error, likely hardware failure."); - retval = 1; - } else { - log(LOG_CRIT, "\nNMI Resume ??\n"); + if ((c = *find++) != 0) { + len = strlen(find); + do { + do { + if ((sc = *s++) == 0) + return (NULL); + } while (sc != c); + } while (strncmp(s, find, len) != 0); + s--; } - - return(retval); + return (__DECONST(char *, s)); }