Deleted Added
full compact
devfs_rule.c (111119) devfs_rule.c (124798)
1/*-
2 * Copyright (c) 2002 Dima Dorfman.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 9 unchanged lines hidden (view full) ---

18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
1/*-
2 * Copyright (c) 2002 Dima Dorfman.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 9 unchanged lines hidden (view full) ---

18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
26 * $FreeBSD: head/sys/fs/devfs/devfs_rule.c 111119 2003-02-19 05:47:46Z imp $
26 * $FreeBSD: head/sys/fs/devfs/devfs_rule.c 124798 2004-01-21 16:43:29Z cperciva $
27 */
28
29/*
30 * DEVFS ruleset implementation.
31 *
32 * A note on terminology: To "run" a rule on a dirent is to take the
33 * prescribed action; to "apply" a rule is to check whether it matches
34 * a dirent and run if if it does.

--- 593 unchanged lines hidden (view full) ---

628{
629 struct devfs_rule *dr = &dk->dk_rule;
630 char *pname;
631 dev_t dev;
632
633 dev = devfs_rule_getdev(de);
634 if (dev != NULL)
635 pname = dev->si_name;
27 */
28
29/*
30 * DEVFS ruleset implementation.
31 *
32 * A note on terminology: To "run" a rule on a dirent is to take the
33 * prescribed action; to "apply" a rule is to check whether it matches
34 * a dirent and run if if it does.

--- 593 unchanged lines hidden (view full) ---

628{
629 struct devfs_rule *dr = &dk->dk_rule;
630 char *pname;
631 dev_t dev;
632
633 dev = devfs_rule_getdev(de);
634 if (dev != NULL)
635 pname = dev->si_name;
636 else if (de->de_dirent->d_type == DT_LNK)
636 else if (de->de_dirent->d_type == DT_LNK ||
637 de->de_dirent->d_type == DT_DIR)
637 pname = de->de_dirent->d_name;
638 else
639 return (0);
640 KASSERT(pname != NULL, ("devfs_rule_matchpath: NULL pname"));
641
642 return (fnmatch(dr->dr_pathptrn, pname, 0) == 0);
643}
644

--- 186 unchanged lines hidden ---
638 pname = de->de_dirent->d_name;
639 else
640 return (0);
641 KASSERT(pname != NULL, ("devfs_rule_matchpath: NULL pname"));
642
643 return (fnmatch(dr->dr_pathptrn, pname, 0) == 0);
644}
645

--- 186 unchanged lines hidden ---