don't compile mknod(1) builtin if MKSH_SMALL

saves 1037 text, 20 data (on i386)
This commit is contained in:
tg 2006-11-09 22:18:10 +00:00
parent 2345d8b72b
commit 3c33cbcecc
3 changed files with 11 additions and 5 deletions

View File

@ -5,7 +5,7 @@
#include "sh.h" #include "sh.h"
__RCSID("$MirOS: src/bin/mksh/funcs.c,v 1.30 2006/08/24 20:32:52 tg Exp $"); __RCSID("$MirOS: src/bin/mksh/funcs.c,v 1.31 2006/11/09 22:18:10 tg Exp $");
int int
c_cd(char **wp) c_cd(char **wp)
@ -2193,6 +2193,7 @@ c_exec(char **wp __attribute__((unused)))
return 0; return 0;
} }
#ifndef MKSH_SMALL
static int static int
c_mknod(char **wp) c_mknod(char **wp)
{ {
@ -2276,6 +2277,7 @@ c_mknod(char **wp)
bi_errorf("usage: mknod [-m mode] name p"); bi_errorf("usage: mknod [-m mode] name p");
return (1); return (1);
} }
#endif
/* dummy function, special case in comexec() */ /* dummy function, special case in comexec() */
int int
@ -2312,7 +2314,9 @@ const struct builtin shbuiltins [] = {
{"ulimit", c_ulimit}, {"ulimit", c_ulimit},
{"+umask", c_umask}, {"+umask", c_umask},
{"*=unset", c_unset}, {"*=unset", c_unset},
#ifndef MKSH_SMALL
{"mknod", c_mknod}, {"mknod", c_mknod},
#endif
{NULL, NULL} {NULL, NULL}
}; };

View File

@ -1,4 +1,5 @@
/** $MirOS: src/bin/mksh/setmode.c,v 1.4 2006/11/08 23:23:41 tg Exp $ */ /** $MirOS: src/bin/mksh/setmode.c,v 1.5 2006/11/09 22:18:10 tg Exp $ */
#ifndef MKSH_SMALL
/** _MirOS: src/lib/libc/gen/setmode.c,v 1.6 2006/11/08 23:18:04 tg Exp $ */ /** _MirOS: src/lib/libc/gen/setmode.c,v 1.6 2006/11/08 23:18:04 tg Exp $ */
/* $OpenBSD: setmode.c,v 1.17 2005/08/08 08:05:34 espie Exp $ */ /* $OpenBSD: setmode.c,v 1.17 2005/08/08 08:05:34 espie Exp $ */
/* $NetBSD: setmode.c,v 1.15 1997/02/07 22:21:06 christos Exp $ */ /* $NetBSD: setmode.c,v 1.15 1997/02/07 22:21:06 christos Exp $ */
@ -58,7 +59,7 @@
#endif #endif
__SCCSID("@(#)setmode.c 8.2 (Berkeley) 3/25/94"); __SCCSID("@(#)setmode.c 8.2 (Berkeley) 3/25/94");
__RCSID("$MirOS: src/bin/mksh/setmode.c,v 1.4 2006/11/08 23:23:41 tg Exp $"); __RCSID("$MirOS: src/bin/mksh/setmode.c,v 1.5 2006/11/09 22:18:10 tg Exp $");
#define SET_LEN 6 /* initial # of bitcmd struct to malloc */ #define SET_LEN 6 /* initial # of bitcmd struct to malloc */
#define SET_LEN_INCR 4 /* # of bitcmd structs to add as needed */ #define SET_LEN_INCR 4 /* # of bitcmd structs to add as needed */
@ -462,3 +463,4 @@ compress_mode(BITCMD *set)
} }
} }
} }
#endif

4
sh.h
View File

@ -8,7 +8,7 @@
/* $OpenBSD: c_test.h,v 1.4 2004/12/20 11:34:26 otto Exp $ */ /* $OpenBSD: c_test.h,v 1.4 2004/12/20 11:34:26 otto Exp $ */
/* $OpenBSD: tty.h,v 1.5 2004/12/20 11:34:26 otto Exp $ */ /* $OpenBSD: tty.h,v 1.5 2004/12/20 11:34:26 otto Exp $ */
#define MKSH_SH_H_ID "$MirOS: src/bin/mksh/sh.h,v 1.64 2006/11/09 22:11:08 tg Exp $" #define MKSH_SH_H_ID "$MirOS: src/bin/mksh/sh.h,v 1.65 2006/11/09 22:18:10 tg Exp $"
#define MKSH_VERSION "R29 2006/11/09" #define MKSH_VERSION "R29 2006/11/09"
#if HAVE_SYS_PARAM_H #if HAVE_SYS_PARAM_H
@ -108,7 +108,7 @@
/* OS-dependent additions */ /* OS-dependent additions */
#if !HAVE_SETMODE #if !HAVE_SETMODE && !defined(MKSH_SMALL)
mode_t getmode(const void *, mode_t); mode_t getmode(const void *, mode_t);
void *setmode(const char *); void *setmode(const char *);
#endif #endif