From owner-svn-src-stable-8@FreeBSD.ORG Sat Apr 16 10:18:08 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 333B7106566B; Sat, 16 Apr 2011 10:18:08 +0000 (UTC) (envelope-from brucec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 21B358FC15; Sat, 16 Apr 2011 10:18:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p3GAI8VC001191; Sat, 16 Apr 2011 10:18:08 GMT (envelope-from brucec@svn.freebsd.org) Received: (from brucec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p3GAI8FS001188; Sat, 16 Apr 2011 10:18:08 GMT (envelope-from brucec@svn.freebsd.org) Message-Id: <201104161018.p3GAI8FS001188@svn.freebsd.org> From: Bruce Cran Date: Sat, 16 Apr 2011 10:18:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r220697 - stable/8/tools/regression/doat X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Apr 2011 10:18:08 -0000 Author: brucec Date: Sat Apr 16 10:18:07 2011 New Revision: 220697 URL: http://svn.freebsd.org/changeset/base/220697 Log: MFC r219568: Fix warnings and style(9) issues. Set WARNS to 6. Modified: stable/8/tools/regression/doat/Makefile stable/8/tools/regression/doat/doat.c Directory Properties: stable/8/tools/regression/doat/ (props changed) Modified: stable/8/tools/regression/doat/Makefile ============================================================================== --- stable/8/tools/regression/doat/Makefile Sat Apr 16 09:57:17 2011 (r220696) +++ stable/8/tools/regression/doat/Makefile Sat Apr 16 10:18:07 2011 (r220697) @@ -3,5 +3,6 @@ PROG= doat NO_MAN= +WARNS?=6 .include Modified: stable/8/tools/regression/doat/doat.c ============================================================================== --- stable/8/tools/regression/doat/doat.c Sat Apr 16 09:57:17 2011 (r220696) +++ stable/8/tools/regression/doat/doat.c Sat Apr 16 10:18:07 2011 (r220697) @@ -26,25 +26,31 @@ * $FreeBSD$ */ +#include +#include +#include + #include #include #include #include #include #include -#include -#include -#include +#include + +void cleanup(void); +void setup(void); +void setup_once(void); union param { int i; - char *cp; + const char *cp; mode_t m; dev_t d; void *vp; uid_t u; gid_t g; - char **cpp; + const char **cpp; }; struct testcase { @@ -55,7 +61,7 @@ struct testcase { struct test { int syscall; int num_of_cases; - char *name; + const char *name; struct testcase tests[10]; /* no more than 10 tests */ }; @@ -64,21 +70,21 @@ struct test *tests; #define NUM_OF_TESTS 14 /* we dont want the fexecve test to run */ char *absolute_path = NULL; -char *relative_path = "tmp/"; -char *not_dir_path = "/bin/date"; +const char *relative_path = "tmp/"; +const char *not_dir_path = "/bin/date"; -char *file = "foo"; +const char *file = "foo"; char *absolute_file = NULL; char *relative_file = NULL; -char *symlinkf = "link"; -char *newlink = "nlink1"; -char *newlink2 = "nlink2"; -char *newlink3 = "nlink3"; -char *newdir = "newdir"; -char *fifo = "fifo"; -char *nod = "nod"; -char *newfile = "newfile"; -char *newslink = "nslink1"; +const char *symlinkf = "link"; +const char *newlink = "nlink1"; +const char *newlink2 = "nlink2"; +const char *newlink3 = "nlink3"; +const char *newdir = "newdir"; +const char *fifo = "fifo"; +const char *nod = "nod"; +const char *newfile = "newfile"; +const char *newslink = "nslink1"; bool dir_exist = false; bool file_exist = false; @@ -88,15 +94,14 @@ int rel_fd, abs_fd, notd_fd, exec_fd; struct timeval times[2]; struct stat buf; -char *pargv[2] = { "/bin/date", NULL }; +const char *pargv[2] = { "/bin/date", NULL }; #define PATH_MAX 1024 char cbuf[PATH_MAX]; void -setup() +setup(void) { int i, error; - size_t siz; struct stat sb; tests = calloc(NUM_OF_TESTS, sizeof(struct test)); @@ -607,13 +612,13 @@ setup() } void -cleanup() +cleanup(void) { system("/bin/sh -c 'rm -rf tmp'"); } void -setup_once() +setup_once(void) { } @@ -623,10 +628,13 @@ main(int argc, char *argv[]) int i,j; int error; + (void)argc; + (void)argv; + setup(); for (i = 0; i < NUM_OF_TESTS; i++) { - printf("\nTest: %s\n", tests[i].name); + printf("\nTest: %s\n", tests[i].name); for (j = 0; j < tests[i].num_of_cases; j++) { error = syscall(tests[i].syscall, tests[i].tests[j].params[0], @@ -652,13 +660,10 @@ main(int argc, char *argv[]) printf("#%i ... OK\n", j); } } - - } } cleanup(); - return (0); }