From owner-svn-src-all@freebsd.org Sun Oct 25 22:33:06 2015 Return-Path: Delivered-To: svn-src-all@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 72493A173EA; Sun, 25 Oct 2015 22:33:06 +0000 (UTC) (envelope-from ngie@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 2D50615FC; Sun, 25 Oct 2015 22:33:06 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9PMX5v5017237; Sun, 25 Oct 2015 22:33:05 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9PMX4dk017231; Sun, 25 Oct 2015 22:33:04 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201510252233.t9PMX4dk017231@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 25 Oct 2015 22:33:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r289955 - stable/9/tools/regression/p1003_1b X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Oct 2015 22:33:06 -0000 Author: ngie Date: Sun Oct 25 22:33:04 2015 New Revision: 289955 URL: https://svnweb.freebsd.org/changeset/base/289955 Log: MFstable/10 r289954: MFC r282072,r283018: r282072: - Fix compilation (MAP_INHERIT's dead) - Fix warnings - Use mkstemp instead of tmpnam r283018: Fix more warnings related to missing headers Modified: stable/9/tools/regression/p1003_1b/Makefile stable/9/tools/regression/p1003_1b/fifo.c stable/9/tools/regression/p1003_1b/main.c stable/9/tools/regression/p1003_1b/prutil.c stable/9/tools/regression/p1003_1b/sched.c stable/9/tools/regression/p1003_1b/yield.c Directory Properties: stable/9/ (props changed) stable/9/tools/ (props changed) stable/9/tools/regression/ (props changed) Modified: stable/9/tools/regression/p1003_1b/Makefile ============================================================================== --- stable/9/tools/regression/p1003_1b/Makefile Sun Oct 25 22:30:45 2015 (r289954) +++ stable/9/tools/regression/p1003_1b/Makefile Sun Oct 25 22:33:04 2015 (r289955) @@ -14,4 +14,5 @@ SRCS=\ NO_MAN= CFLAGS+=-DNO_MEMLOCK + .include Modified: stable/9/tools/regression/p1003_1b/fifo.c ============================================================================== --- stable/9/tools/regression/p1003_1b/fifo.c Sun Oct 25 22:30:45 2015 (r289954) +++ stable/9/tools/regression/p1003_1b/fifo.c Sun Oct 25 22:33:04 2015 (r289955) @@ -31,17 +31,17 @@ * * $FreeBSD$ */ -#include -#include -#include -#include -#include -#include #include #include #include +#include +#include +#include #include #include +#include +#include +#include volatile int ticked; #define CAN_USE_ALARMS @@ -109,7 +109,7 @@ int fifo(int argc, char *argv[]) fifo_param.sched_priority = 1; p = (long *)mmap(0, sizeof(*p), - PROT_READ|PROT_WRITE, MAP_ANON|MAP_SHARED|MAP_INHERIT, -1, 0); + PROT_READ|PROT_WRITE, MAP_ANON|MAP_SHARED, -1, 0); if (p == (long *)-1) err(errno, "mmap"); Modified: stable/9/tools/regression/p1003_1b/main.c ============================================================================== --- stable/9/tools/regression/p1003_1b/main.c Sun Oct 25 22:30:45 2015 (r289954) +++ stable/9/tools/regression/p1003_1b/main.c Sun Oct 25 22:33:04 2015 (r289955) @@ -1,5 +1,6 @@ /* $FreeBSD$ */ #include +#include int fifo(int argc, char *argv[]); int memlock(int argc, char *argv[]); Modified: stable/9/tools/regression/p1003_1b/prutil.c ============================================================================== --- stable/9/tools/regression/p1003_1b/prutil.c Sun Oct 25 22:30:45 2015 (r289954) +++ stable/9/tools/regression/p1003_1b/prutil.c Sun Oct 25 22:33:04 2015 (r289955) @@ -1,10 +1,11 @@ +#include #include -#include #include #include - -#include +#include #include +#include + #include "prutil.h" /* @@ -12,7 +13,7 @@ */ void quit(const char *text) { - err(errno, text); + err(errno, "%s", text); } char *sched_text(int scheduler) Modified: stable/9/tools/regression/p1003_1b/sched.c ============================================================================== --- stable/9/tools/regression/p1003_1b/sched.c Sun Oct 25 22:30:45 2015 (r289954) +++ stable/9/tools/regression/p1003_1b/sched.c Sun Oct 25 22:33:04 2015 (r289955) @@ -41,16 +41,17 @@ #define _POSIX_SOURCE #define _POSIX_C_SOURCE 199309L -#include -#include - -#include -#include +#include #include #include -#include - +#include #include +#include +#define __XSI_VISIBLE 1 +#include +#undef __XSI_VISIBLE +#include +#include #include "prutil.h" @@ -209,17 +210,14 @@ int sched(int ac, char *av[]) { -#define NAM "P1003_1b_schedXXXX" - char nam[L_tmpnam]; + char nam[] = "P1003_1b_schedXXXXXX"; int fd; pid_t p; pid_t *lastrun; - strcpy(nam, NAM); - if (tmpnam(nam) != nam) - q(__LINE__, errno, "tmpnam " NAM); - q(__LINE__, (fd = open(nam, O_RDWR|O_CREAT, 0666)), - "open " NAM); + fd = mkstemp(nam); + if (fd == -1) + q(__LINE__, errno, "mkstemp failed"); (void)unlink(nam); Modified: stable/9/tools/regression/p1003_1b/yield.c ============================================================================== --- stable/9/tools/regression/p1003_1b/yield.c Sun Oct 25 22:30:45 2015 (r289954) +++ stable/9/tools/regression/p1003_1b/yield.c Sun Oct 25 22:33:04 2015 (r289955) @@ -89,7 +89,7 @@ int yield(int argc, char *argv[]) n = nslaves = atoi(argv[1]); p = (int *)mmap(0, sizeof(int), - PROT_READ|PROT_WRITE, MAP_ANON|MAP_SHARED|MAP_INHERIT, -1, 0); + PROT_READ|PROT_WRITE, MAP_ANON|MAP_SHARED, -1, 0); if (p == (int *)-1) err(errno, "mmap");