Source-Changes-HG archive

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

[src/trunk]: src/usr.sbin/autofs avoid passing literal string to unconst.



details:   https://anonhg.NetBSD.org/src/rev/d77861950bea
branches:  trunk
changeset: 829051:d77861950bea
user:      christos <christos%NetBSD.org@localhost>
date:      Mon Jan 15 14:38:06 2018 +0000

description:
avoid passing literal string to unconst.

diffstat:

 usr.sbin/autofs/automount.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (35 lines):

diff -r 2fb17984b814 -r d77861950bea usr.sbin/autofs/automount.c
--- a/usr.sbin/autofs/automount.c       Mon Jan 15 14:00:34 2018 +0000
+++ b/usr.sbin/autofs/automount.c       Mon Jan 15 14:38:06 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: automount.c,v 1.2 2018/01/15 00:46:16 christos Exp $   */
+/*     $NetBSD: automount.c,v 1.3 2018/01/15 14:38:06 christos Exp $   */
 
 /*-
  * Copyright (c) 2017 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  * SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: automount.c,v 1.2 2018/01/15 00:46:16 christos Exp $");
+__RCSID("$NetBSD: automount.c,v 1.3 2018/01/15 14:38:06 christos Exp $");
 
 #include <sys/types.h>
 #include <sys/mount.h>
@@ -155,6 +155,7 @@
        struct statvfs *mntbuf;
        struct node *n, *n2;
        int i, nitems;
+       static char rootdir[] = "/";
 
        nitems = getmntinfo(&mntbuf, MNT_WAIT);
        if (nitems <= 0)
@@ -192,7 +193,7 @@
 
                TAILQ_FOREACH(n2, &n->n_children, n_next) {
                        mount_if_not_already(n2, n->n_map, n->n_options,
-                           "/", mntbuf, nitems);
+                           rootdir, mntbuf, nitems);
                }
        }
 }



Home | Main Index | Thread Index | Old Index