diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2016-03-04 15:11:08 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2016-03-04 15:11:08 +0000 |
commit | bfe43f07a4324526ca32a368a0d64e86333e4b74 (patch) | |
tree | ca345166acbc71c3fc3b3e8004a89fe22d750f3d /bin/ksh/c_sh.c | |
parent | a9db67657a20faf74a677d11ce4abd9ee5f5b539 (diff) |
remove CSRG BSD-licensed mknod builtin code which was previously used to
accelerate install/upgrade time MAKEDEV runs. That allows ramdisk ksh
to be pledged, without needing "dpath". We'll solve the performance issues
a different way (soon).
ok otto espie natano tb tobiasu rpe
Diffstat (limited to 'bin/ksh/c_sh.c')
-rw-r--r-- | bin/ksh/c_sh.c | 61 |
1 files changed, 1 insertions, 60 deletions
diff --git a/bin/ksh/c_sh.c b/bin/ksh/c_sh.c index a5cc99282f9..4e40c464ecb 100644 --- a/bin/ksh/c_sh.c +++ b/bin/ksh/c_sh.c @@ -1,4 +1,4 @@ -/* $OpenBSD: c_sh.c,v 1.58 2015/12/30 09:07:00 tedu Exp $ */ +/* $OpenBSD: c_sh.c,v 1.59 2016/03/04 15:11:06 deraadt Exp $ */ /* * built-in Bourne commands @@ -826,62 +826,6 @@ c_exec(char **wp) return 0; } -#ifdef MKNOD -static int -c_mknod(char **wp) -{ - int argc, optc, ismkfifo = 0, ret; - char **argv; - void *set = NULL; - mode_t mode = 0, oldmode = 0; - - while ((optc = ksh_getopt(wp, &builtin_opt, "m:")) != -1) { - switch (optc) { - case 'm': - set = setmode(builtin_opt.optarg); - if (set == NULL) { - bi_errorf("invalid file mode"); - return 1; - } - mode = getmode(set, DEFFILEMODE); - free(set); - break; - default: - goto usage; - } - } - argv = &wp[builtin_opt.optind]; - if (argv[0] == NULL) - goto usage; - for (argc = 0; argv[argc]; argc++) - ; - if (argc == 2 && argv[1][0] == 'p') { - ismkfifo = 1; - argc--; - } else if (argc != 4) - goto usage; - - if (set) - oldmode = umask(0); - else - mode = DEFFILEMODE; - - if (ismkfifo) - ret = domkfifo(argc, argv, mode); - else - ret = domknod(argc, argv, mode); - - if (set) - umask(oldmode); - return ret; -usage: - builtin_argv0 = NULL; - bi_errorf("usage: mknod [-m mode] name b|c major minor"); - bi_errorf("usage: mknod [-m mode] name p"); - return 1; -} -#endif /* MKNOD */ - static int c_suspend(char **wp) { @@ -940,9 +884,6 @@ const struct builtin shbuiltins [] = { {"ulimit", c_ulimit}, {"+umask", c_umask}, {"*=unset", c_unset}, -#ifdef MKNOD - {"mknod", c_mknod}, -#endif {"suspend", c_suspend}, {NULL, NULL} }; |