Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src Define _PATH_CPUCTL.



details:   https://anonhg.NetBSD.org/src/rev/722fc76031fe
branches:  trunk
changeset: 769950:722fc76031fe
user:      jruoho <jruoho%NetBSD.org@localhost>
date:      Tue Sep 27 11:24:20 2011 +0000

description:
Define _PATH_CPUCTL.

diffstat:

 include/paths.h          |  3 ++-
 tests/include/t_paths.c  |  7 ++++---
 usr.sbin/cpuctl/cpuctl.c |  9 +++++----
 3 files changed, 11 insertions(+), 8 deletions(-)

diffs (89 lines):

diff -r d6efc73cb484 -r 722fc76031fe include/paths.h
--- a/include/paths.h   Tue Sep 27 11:12:49 2011 +0000
+++ b/include/paths.h   Tue Sep 27 11:24:20 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: paths.h,v 1.39 2010/12/29 15:53:57 pooka Exp $ */
+/*     $NetBSD: paths.h,v 1.40 2011/09/27 11:24:20 jruoho Exp $        */
 
 /*
  * Copyright (c) 1989, 1993
@@ -61,6 +61,7 @@
 #define        _PATH_CLOCKCTL  "/dev/clockctl"
 #define        _PATH_CONSOLE   "/dev/console"
 #define        _PATH_CONSTTY   "/dev/constty"
+#define _PATH_CPUCTL   "/dev/cpuctl"
 #define        _PATH_CSMAPPER  "/usr/share/i18n/csmapper"
 #define        _PATH_DEFTAPE   "/dev/nrst0"
 #define        _PATH_DEVDB     "/var/run/dev.db"
diff -r d6efc73cb484 -r 722fc76031fe tests/include/t_paths.c
--- a/tests/include/t_paths.c   Tue Sep 27 11:12:49 2011 +0000
+++ b/tests/include/t_paths.c   Tue Sep 27 11:24:20 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: t_paths.c,v 1.8 2011/08/12 03:59:44 riastradh Exp $ */
+/*     $NetBSD: t_paths.c,v 1.9 2011/09/27 11:24:21 jruoho Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: t_paths.c,v 1.8 2011/08/12 03:59:44 riastradh Exp $");
+__RCSID("$NetBSD: t_paths.c,v 1.9 2011/09/27 11:24:21 jruoho Exp $");
 
 #include <sys/param.h>
 #include <sys/stat.h>
@@ -59,6 +59,7 @@
        { _PATH_CLOCKCTL,       PATH_DEV | PATH_ROOT    },
        { _PATH_CONSOLE,        PATH_DEV | PATH_ROOT    },
        { _PATH_CONSTTY,        PATH_DEV | PATH_ROOT    },
+       { _PATH_CPUCTL,         PATH_DEV                },
        { _PATH_CSMAPPER,       PATH_DIR                },
        { _PATH_DEFTAPE,        PATH_DEV | PATH_ROOT    },
        { _PATH_DEVDB,          PATH_FILE               },
@@ -91,7 +92,7 @@
        { _PATH_SOUND0,         PATH_DEV                },
        { _PATH_SYSMON,         PATH_DEV                },
        { _PATH_TTY,            PATH_DEV                },
-       { _PATH_UNIX,           PATH_FILE               },
+       { _PATH_UNIX,           PATH_FILE | PATH_ROOT   },
        { _PATH_URANDOM,        PATH_DEV                },
        { _PATH_VIDEO,          PATH_DEV                },
        { _PATH_VIDEO0,         PATH_DEV                },
diff -r d6efc73cb484 -r 722fc76031fe usr.sbin/cpuctl/cpuctl.c
--- a/usr.sbin/cpuctl/cpuctl.c  Tue Sep 27 11:12:49 2011 +0000
+++ b/usr.sbin/cpuctl/cpuctl.c  Tue Sep 27 11:24:20 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpuctl.c,v 1.18 2011/09/26 06:51:57 jruoho Exp $       */
+/*     $NetBSD: cpuctl.c,v 1.19 2011/09/27 11:24:21 jruoho Exp $       */
 
 /*-
  * Copyright (c) 2007, 2008, 2009 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #ifndef lint
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: cpuctl.c,v 1.18 2011/09/26 06:51:57 jruoho Exp $");
+__RCSID("$NetBSD: cpuctl.c,v 1.19 2011/09/27 11:24:21 jruoho Exp $");
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -42,6 +42,7 @@
 #include <err.h>
 #include <errno.h>
 #include <fcntl.h>
+#include <paths.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <stdarg.h>
@@ -87,8 +88,8 @@
        if (argc < 2)
                usage();
 
-       if ((fd = open("/dev/cpuctl", O_RDWR)) < 0)
-               err(EXIT_FAILURE, "/dev/cpuctl");
+       if ((fd = open(_PATH_CPUCTL, O_RDWR)) < 0)
+               err(EXIT_FAILURE, _PATH_CPUCTL);
 
        for (ct = cpu_cmdtab; ct->label != NULL; ct++) {
                if (strcmp(argv[1], ct->label) == 0) {



Home | Main Index | Thread Index | Old Index