actually, we need the android lsmod to be a builtin not an alias…
This commit is contained in:
parent
1c22b3cc48
commit
5239e8ea4c
76
check.t
76
check.t
@ -1,4 +1,4 @@
|
|||||||
# $MirOS: src/bin/mksh/check.t,v 1.428 2011/03/16 20:26:34 tg Exp $
|
# $MirOS: src/bin/mksh/check.t,v 1.429 2011/03/16 20:56:30 tg Exp $
|
||||||
# $OpenBSD: bksl-nl.t,v 1.2 2001/01/28 23:04:56 niklas Exp $
|
# $OpenBSD: bksl-nl.t,v 1.2 2001/01/28 23:04:56 niklas Exp $
|
||||||
# $OpenBSD: history.t,v 1.5 2001/01/28 23:04:56 niklas Exp $
|
# $OpenBSD: history.t,v 1.5 2001/01/28 23:04:56 niklas Exp $
|
||||||
# $OpenBSD: read.t,v 1.3 2003/03/10 03:48:16 david Exp $
|
# $OpenBSD: read.t,v 1.3 2003/03/10 03:48:16 david Exp $
|
||||||
@ -5528,7 +5528,7 @@ expected-stdout:
|
|||||||
name: aliases-1-hartz4
|
name: aliases-1-hartz4
|
||||||
description:
|
description:
|
||||||
Check if built-in shell aliases are okay
|
Check if built-in shell aliases are okay
|
||||||
category: arge
|
category: android,arge
|
||||||
stdin:
|
stdin:
|
||||||
alias
|
alias
|
||||||
typeset -f
|
typeset -f
|
||||||
@ -5546,28 +5546,6 @@ expected-stdout:
|
|||||||
source='PATH=$PATH:. command .'
|
source='PATH=$PATH:. command .'
|
||||||
type='whence -v'
|
type='whence -v'
|
||||||
---
|
---
|
||||||
name: aliases-1-android
|
|
||||||
description:
|
|
||||||
Check if built-in shell aliases are okay
|
|
||||||
category: android
|
|
||||||
stdin:
|
|
||||||
alias
|
|
||||||
typeset -f
|
|
||||||
expected-stdout:
|
|
||||||
autoload='typeset -fu'
|
|
||||||
functions='typeset -f'
|
|
||||||
hash='alias -t'
|
|
||||||
history='fc -l'
|
|
||||||
integer='typeset -i'
|
|
||||||
local=typeset
|
|
||||||
login='exec login'
|
|
||||||
lsmod='cat /proc/modules'
|
|
||||||
nameref='typeset -n'
|
|
||||||
nohup='nohup '
|
|
||||||
r='fc -e -'
|
|
||||||
source='PATH=$PATH:. command .'
|
|
||||||
type='whence -v'
|
|
||||||
---
|
|
||||||
name: aliases-2a
|
name: aliases-2a
|
||||||
description:
|
description:
|
||||||
Check if “set -o sh” disables built-in aliases (except a few)
|
Check if “set -o sh” disables built-in aliases (except a few)
|
||||||
@ -5643,7 +5621,7 @@ expected-stdout:
|
|||||||
name: aliases-2b-hartz4
|
name: aliases-2b-hartz4
|
||||||
description:
|
description:
|
||||||
Check if “set -o sh” does not influence built-in aliases
|
Check if “set -o sh” does not influence built-in aliases
|
||||||
category: arge
|
category: android,arge
|
||||||
arguments: !-o!sh!
|
arguments: !-o!sh!
|
||||||
stdin:
|
stdin:
|
||||||
alias
|
alias
|
||||||
@ -5665,7 +5643,7 @@ expected-stdout:
|
|||||||
name: aliases-3b-hartz4
|
name: aliases-3b-hartz4
|
||||||
description:
|
description:
|
||||||
Check if running as sh does not influence built-in aliases
|
Check if running as sh does not influence built-in aliases
|
||||||
category: arge
|
category: android,arge
|
||||||
stdin:
|
stdin:
|
||||||
cp "$__progname" sh
|
cp "$__progname" sh
|
||||||
./sh -c 'alias; typeset -f'
|
./sh -c 'alias; typeset -f'
|
||||||
@ -5684,52 +5662,6 @@ expected-stdout:
|
|||||||
source='PATH=$PATH:. command .'
|
source='PATH=$PATH:. command .'
|
||||||
type='whence -v'
|
type='whence -v'
|
||||||
---
|
---
|
||||||
name: aliases-2b-android
|
|
||||||
description:
|
|
||||||
Check if “set -o sh” does not influence built-in aliases
|
|
||||||
category: android
|
|
||||||
arguments: !-o!sh!
|
|
||||||
stdin:
|
|
||||||
alias
|
|
||||||
typeset -f
|
|
||||||
expected-stdout:
|
|
||||||
autoload='typeset -fu'
|
|
||||||
functions='typeset -f'
|
|
||||||
hash='alias -t'
|
|
||||||
history='fc -l'
|
|
||||||
integer='typeset -i'
|
|
||||||
local=typeset
|
|
||||||
login='exec login'
|
|
||||||
lsmod='cat /proc/modules'
|
|
||||||
nameref='typeset -n'
|
|
||||||
nohup='nohup '
|
|
||||||
r='fc -e -'
|
|
||||||
source='PATH=$PATH:. command .'
|
|
||||||
type='whence -v'
|
|
||||||
---
|
|
||||||
name: aliases-3b-android
|
|
||||||
description:
|
|
||||||
Check if running as sh does not influence built-in aliases
|
|
||||||
category: android
|
|
||||||
stdin:
|
|
||||||
cp "$__progname" sh
|
|
||||||
./sh -c 'alias; typeset -f'
|
|
||||||
rm -f sh
|
|
||||||
expected-stdout:
|
|
||||||
autoload='typeset -fu'
|
|
||||||
functions='typeset -f'
|
|
||||||
hash='alias -t'
|
|
||||||
history='fc -l'
|
|
||||||
integer='typeset -i'
|
|
||||||
local=typeset
|
|
||||||
login='exec login'
|
|
||||||
lsmod='cat /proc/modules'
|
|
||||||
nameref='typeset -n'
|
|
||||||
nohup='nohup '
|
|
||||||
r='fc -e -'
|
|
||||||
source='PATH=$PATH:. command .'
|
|
||||||
type='whence -v'
|
|
||||||
---
|
|
||||||
name: aliases-funcdef-1
|
name: aliases-funcdef-1
|
||||||
description:
|
description:
|
||||||
Check if POSIX functions take precedences over aliases
|
Check if POSIX functions take precedences over aliases
|
||||||
|
20
funcs.c
20
funcs.c
@ -38,7 +38,7 @@
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
__RCSID("$MirOS: src/bin/mksh/funcs.c,v 1.176 2011/03/13 01:20:19 tg Exp $");
|
__RCSID("$MirOS: src/bin/mksh/funcs.c,v 1.177 2011/03/16 20:56:32 tg Exp $");
|
||||||
|
|
||||||
#if HAVE_KILLPG
|
#if HAVE_KILLPG
|
||||||
/*
|
/*
|
||||||
@ -60,6 +60,10 @@ __RCSID("$MirOS: src/bin/mksh/funcs.c,v 1.176 2011/03/13 01:20:19 tg Exp $");
|
|||||||
#define c_ulimit c_label
|
#define c_ulimit c_label
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(ANDROID)
|
||||||
|
static int c_android_lsmod(const char **);
|
||||||
|
#endif
|
||||||
|
|
||||||
extern uint8_t set_refflag;
|
extern uint8_t set_refflag;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -130,6 +134,9 @@ const struct builtin mkshbuiltins[] = {
|
|||||||
#ifdef __MirBSD__
|
#ifdef __MirBSD__
|
||||||
/* alias to "true" for historical reasons */
|
/* alias to "true" for historical reasons */
|
||||||
{"domainname", c_label},
|
{"domainname", c_label},
|
||||||
|
#endif
|
||||||
|
#if defined(ANDROID)
|
||||||
|
{"lsmod", c_android_lsmod},
|
||||||
#endif
|
#endif
|
||||||
{NULL, (int (*)(const char **))NULL}
|
{NULL, (int (*)(const char **))NULL}
|
||||||
};
|
};
|
||||||
@ -3717,3 +3724,14 @@ c_sleep(const char **wp)
|
|||||||
return (rv);
|
return (rv);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(ANDROID)
|
||||||
|
static int
|
||||||
|
c_android_lsmod(const char **wp MKSH_A_UNUSED)
|
||||||
|
{
|
||||||
|
const char *cwp[3] = { "cat", "/proc/modules", NULL };
|
||||||
|
|
||||||
|
builtin_argv0 = cwp[0];
|
||||||
|
return (c_cat(cwp));
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
7
main.c
7
main.c
@ -33,7 +33,7 @@
|
|||||||
#include <locale.h>
|
#include <locale.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
__RCSID("$MirOS: src/bin/mksh/main.c,v 1.183 2011/03/16 20:43:34 tg Exp $");
|
__RCSID("$MirOS: src/bin/mksh/main.c,v 1.184 2011/03/16 20:56:33 tg Exp $");
|
||||||
|
|
||||||
extern char **environ;
|
extern char **environ;
|
||||||
|
|
||||||
@ -70,10 +70,7 @@ static const char *initcoms[] = {
|
|||||||
/* not "alias -t --": hash -r needs to work */
|
/* not "alias -t --": hash -r needs to work */
|
||||||
"hash=alias -t",
|
"hash=alias -t",
|
||||||
"type=whence -v",
|
"type=whence -v",
|
||||||
#if defined(ANDROID)
|
#if !defined(ANDROID) && !defined(MKSH_UNEMPLOYED)
|
||||||
/* evil hack */
|
|
||||||
"lsmod=cat /proc/modules",
|
|
||||||
#elif !defined(MKSH_UNEMPLOYED)
|
|
||||||
/* not in Android for political reasons */
|
/* not in Android for political reasons */
|
||||||
/* not in ARGE mksh due to no job control */
|
/* not in ARGE mksh due to no job control */
|
||||||
"stop=kill -STOP",
|
"stop=kill -STOP",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user