diff options
author | scrappy <scrappy@FreeBSD.org> | 1996-04-03 03:03:27 +0000 |
---|---|---|
committer | scrappy <scrappy@FreeBSD.org> | 1996-04-03 03:03:27 +0000 |
commit | 2e8aad5ee10684282d3418e45b34d31b819b0644 (patch) | |
tree | 93fed51abebfbf2ed4c6f53ad7af1776e5d07ab8 | |
parent | ee9f97b773359ed6ebe29fdf8486f55e97540354 (diff) | |
download | FreeBSD-src-2e8aad5ee10684282d3418e45b34d31b819b0644.zip FreeBSD-src-2e8aad5ee10684282d3418e45b34d31b819b0644.tar.gz |
Merged devfs_add_devsw() into devfs_add_devswf()
-rw-r--r-- | sys/miscfs/devfs/devfs_tree.c | 51 |
1 files changed, 17 insertions, 34 deletions
diff --git a/sys/miscfs/devfs/devfs_tree.c b/sys/miscfs/devfs/devfs_tree.c index 65e5d0a..37d1b6d 100644 --- a/sys/miscfs/devfs/devfs_tree.c +++ b/sys/miscfs/devfs/devfs_tree.c @@ -2,7 +2,7 @@ /* * Written by Julian Elischer (julian@DIALix.oz.au) * - * $Header: /home/ncvs/src/sys/miscfs/devfs/devfs_tree.c,v 1.20 1996/03/28 14:32:27 scrappy Exp $ + * $Header: /home/ncvs/src/sys/miscfs/devfs/devfs_tree.c,v 1.21 1996/04/02 04:53:05 scrappy Exp $ */ #include "param.h" @@ -909,55 +909,38 @@ void *devfs_add_devswf( char *fmt, ...) { + int major; + devnm_p new_dev; + dn_p dnp; /* devnode for parent directory */ + struct cdevsw *cd; + struct bdevsw *bd; + int retval; + union typeinfo by; + va_list ap; - char *p, buf[256]; /* XXX */ + char *name, *path, buf[256]; /* XXX */ int i; va_start(ap, fmt); i = kvprintf(fmt, NULL, (void*)buf, 32, ap); va_end(ap); buf[i] = '\0'; - p = NULL; + name = NULL; for(i=strlen(buf); i>0; i--) if(buf[i] == '/') { - p=&buf[i]; + name=&buf[i]; buf[i]=0; break; } - if (p) { - *p++ = '\0'; - return devfs_add_devsw(buf, p, devsw, minor, chrblk, - uid, gid, perms); + if (name) { + *name++ = '\0'; + path = buf; } else { - return devfs_add_devsw("/", buf, devsw, minor, chrblk, - uid, gid, perms); + name = buf; + path = "/"; } -} - -/***********************************************************************\ -* Add the named device entry into the given directory, and make it * -* The appropriate type... (called (sometimes indirectly) by drivers..) * -* this function is exported.. see sys/devfsext.h * -* Possibly this should be 'unexported' in the future.. * -\***********************************************************************/ -void *devfs_add_devsw(char *path, - char *name, - void *devsw, - int minor, - int chrblk, - uid_t uid, - gid_t gid, - int perms) -{ - int major; - devnm_p new_dev; - dn_p dnp; /* devnode for parent directory */ - struct cdevsw *cd; - struct bdevsw *bd; - int retval; - union typeinfo by; DBPRINT(("dev_add\n")); retval = dev_finddir(path,NULL,1,&dnp); |