mirror of
https://github.com/topjohnwu/ndk-busybox.git
synced 2024-11-24 12:19:49 +00:00
Svn 16007 broke the build under gcc 4.0.3. This fixes up some of the damage
(the e2fsprogs directory is too twisty and evil to easily fix, but I plan to rewrite it anyway so I'll just bump that up in priority a bit).
This commit is contained in:
parent
8c1eda528a
commit
88621d7398
@ -115,7 +115,7 @@ enum TarFileType {
|
|||||||
typedef enum TarFileType TarFileType;
|
typedef enum TarFileType TarFileType;
|
||||||
|
|
||||||
/* Might be faster (and bigger) if the dev/ino were stored in numeric order;) */
|
/* Might be faster (and bigger) if the dev/ino were stored in numeric order;) */
|
||||||
static inline void addHardLinkInfo(HardLinkInfo ** hlInfoHeadPtr,
|
static void addHardLinkInfo(HardLinkInfo ** hlInfoHeadPtr,
|
||||||
struct stat *statbuf,
|
struct stat *statbuf,
|
||||||
const char *name)
|
const char *name)
|
||||||
{
|
{
|
||||||
@ -149,7 +149,7 @@ static void freeHardLinkInfo(HardLinkInfo ** hlInfoHeadPtr)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Might be faster (and bigger) if the dev/ino were stored in numeric order;) */
|
/* Might be faster (and bigger) if the dev/ino were stored in numeric order;) */
|
||||||
static inline HardLinkInfo *findHardLinkInfo(HardLinkInfo * hlInfo, struct stat *statbuf)
|
static HardLinkInfo *findHardLinkInfo(HardLinkInfo * hlInfo, struct stat *statbuf)
|
||||||
{
|
{
|
||||||
while (hlInfo) {
|
while (hlInfo) {
|
||||||
if ((statbuf->st_ino == hlInfo->ino) && (statbuf->st_dev == hlInfo->dev))
|
if ((statbuf->st_ino == hlInfo->ino) && (statbuf->st_dev == hlInfo->dev))
|
||||||
@ -194,7 +194,7 @@ static int putOctal(char *cp, int len, long value)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Write out a tar header for the specified file/directory/whatever */
|
/* Write out a tar header for the specified file/directory/whatever */
|
||||||
static inline int writeTarHeader(struct TarBallInfo *tbInfo,
|
static int writeTarHeader(struct TarBallInfo *tbInfo,
|
||||||
const char *header_name, const char *real_name, struct stat *statbuf)
|
const char *header_name, const char *real_name, struct stat *statbuf)
|
||||||
{
|
{
|
||||||
long chksum = 0;
|
long chksum = 0;
|
||||||
@ -294,7 +294,7 @@ static inline int writeTarHeader(struct TarBallInfo *tbInfo,
|
|||||||
}
|
}
|
||||||
|
|
||||||
# ifdef CONFIG_FEATURE_TAR_FROM
|
# ifdef CONFIG_FEATURE_TAR_FROM
|
||||||
static inline int exclude_file(const llist_t *excluded_files, const char *file)
|
static int exclude_file(const llist_t *excluded_files, const char *file)
|
||||||
{
|
{
|
||||||
while (excluded_files) {
|
while (excluded_files) {
|
||||||
if (excluded_files->data[0] == '/') {
|
if (excluded_files->data[0] == '/') {
|
||||||
@ -411,7 +411,7 @@ static int writeFileToTarball(const char *fileName, struct stat *statbuf,
|
|||||||
return (TRUE);
|
return (TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int writeTarFile(const int tar_fd, const int verboseFlag,
|
static int writeTarFile(const int tar_fd, const int verboseFlag,
|
||||||
const unsigned long dereferenceFlag, const llist_t *include,
|
const unsigned long dereferenceFlag, const llist_t *include,
|
||||||
const llist_t *exclude, const int gzip)
|
const llist_t *exclude, const int gzip)
|
||||||
{
|
{
|
||||||
|
@ -593,7 +593,7 @@ static char nextchar(char **s)
|
|||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int isalnum_(int c)
|
static int ATTRIBUTE_ALWAYS_INLINE isalnum_(int c)
|
||||||
{
|
{
|
||||||
return (isalnum(c) || c == '_');
|
return (isalnum(c) || c == '_');
|
||||||
}
|
}
|
||||||
|
@ -173,10 +173,7 @@ static void loop_forever(void)
|
|||||||
#if ENABLE_DEBUG_INIT
|
#if ENABLE_DEBUG_INIT
|
||||||
#define messageD message
|
#define messageD message
|
||||||
#else
|
#else
|
||||||
static inline void messageD(int ATTRIBUTE_UNUSED device,
|
#define messageD(...) do {;} while(0);
|
||||||
const char ATTRIBUTE_UNUSED *fmt, ...)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
static void message(int device, const char *fmt, ...)
|
static void message(int device, const char *fmt, ...)
|
||||||
__attribute__ ((format(printf, 2, 3)));
|
__attribute__ ((format(printf, 2, 3)));
|
||||||
|
@ -1945,7 +1945,7 @@ static void arch_create_got(struct obj_file *f)
|
|||||||
/*======================================================================*/
|
/*======================================================================*/
|
||||||
|
|
||||||
/* Standard ELF hash function. */
|
/* Standard ELF hash function. */
|
||||||
static inline unsigned long obj_elf_hash_n(const char *name, unsigned long n)
|
static unsigned long obj_elf_hash_n(const char *name, unsigned long n)
|
||||||
{
|
{
|
||||||
unsigned long h = 0;
|
unsigned long h = 0;
|
||||||
unsigned long g;
|
unsigned long g;
|
||||||
|
@ -64,7 +64,7 @@ static void replyError(int s, char *buf);
|
|||||||
static const char *nobodystr = "nobody"; /* this needs to be declared like this */
|
static const char *nobodystr = "nobody"; /* this needs to be declared like this */
|
||||||
static char *bind_ip_address = "0.0.0.0";
|
static char *bind_ip_address = "0.0.0.0";
|
||||||
|
|
||||||
static inline void movefd(int from, int to)
|
static void movefd(int from, int to)
|
||||||
{
|
{
|
||||||
if (from != to) {
|
if (from != to) {
|
||||||
dup2(from, to);
|
dup2(from, to);
|
||||||
@ -108,7 +108,7 @@ static void handlexitsigs(int signum)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* May succeed. If not, won't care. */
|
/* May succeed. If not, won't care. */
|
||||||
static inline void writepid(uid_t nobody, uid_t nogrp)
|
static void writepid(uid_t nobody, uid_t nogrp)
|
||||||
{
|
{
|
||||||
char buf[24];
|
char buf[24];
|
||||||
int fd = open(PIDFILE, O_WRONLY|O_CREAT|O_TRUNC, 0664);
|
int fd = open(PIDFILE, O_WRONLY|O_CREAT|O_TRUNC, 0664);
|
||||||
|
@ -88,7 +88,7 @@ struct Globalvars * Gptr;
|
|||||||
#define G (*Gptr)
|
#define G (*Gptr)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static inline void iacflush(void)
|
static void iacflush(void)
|
||||||
{
|
{
|
||||||
write(G.netfd, G.iacbuf, G.iaclen);
|
write(G.netfd, G.iacbuf, G.iaclen);
|
||||||
G.iaclen = 0;
|
G.iaclen = 0;
|
||||||
@ -291,7 +291,7 @@ static void handlenetinput(int len)
|
|||||||
|
|
||||||
/* ******************************* */
|
/* ******************************* */
|
||||||
|
|
||||||
static inline void putiac(int c)
|
static void putiac(int c)
|
||||||
{
|
{
|
||||||
G.iacbuf[G.iaclen++] = c;
|
G.iacbuf[G.iaclen++] = c;
|
||||||
}
|
}
|
||||||
@ -428,13 +428,13 @@ static void do_linemode(void)
|
|||||||
|
|
||||||
/* ******************************* */
|
/* ******************************* */
|
||||||
|
|
||||||
static inline void to_notsup(char c)
|
static void to_notsup(char c)
|
||||||
{
|
{
|
||||||
if (G.telwish == WILL) putiac2(DONT, c);
|
if (G.telwish == WILL) putiac2(DONT, c);
|
||||||
else if (G.telwish == DO) putiac2(WONT, c);
|
else if (G.telwish == DO) putiac2(WONT, c);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void to_echo(void)
|
static void to_echo(void)
|
||||||
{
|
{
|
||||||
/* if server requests ECHO, don't agree */
|
/* if server requests ECHO, don't agree */
|
||||||
if (G.telwish == DO) { putiac2(WONT, TELOPT_ECHO); return; }
|
if (G.telwish == DO) { putiac2(WONT, TELOPT_ECHO); return; }
|
||||||
@ -461,7 +461,7 @@ static inline void to_echo(void)
|
|||||||
WriteCS(1, "\r\n"); /* sudden modec */
|
WriteCS(1, "\r\n"); /* sudden modec */
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void to_sga(void)
|
static void to_sga(void)
|
||||||
{
|
{
|
||||||
/* daemon always sends will/wont, client do/dont */
|
/* daemon always sends will/wont, client do/dont */
|
||||||
|
|
||||||
@ -483,7 +483,7 @@ static inline void to_sga(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_FEATURE_TELNET_TTYPE
|
#ifdef CONFIG_FEATURE_TELNET_TTYPE
|
||||||
static inline void to_ttype(void)
|
static void to_ttype(void)
|
||||||
{
|
{
|
||||||
/* Tell server we will (or won't) do TTYPE */
|
/* Tell server we will (or won't) do TTYPE */
|
||||||
|
|
||||||
@ -497,7 +497,7 @@ static inline void to_ttype(void)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_FEATURE_TELNET_AUTOLOGIN
|
#ifdef CONFIG_FEATURE_TELNET_AUTOLOGIN
|
||||||
static inline void to_new_environ(void)
|
static void to_new_environ(void)
|
||||||
{
|
{
|
||||||
/* Tell server we will (or will not) do AUTOLOGIN */
|
/* Tell server we will (or will not) do AUTOLOGIN */
|
||||||
|
|
||||||
@ -511,7 +511,7 @@ static inline void to_new_environ(void)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_FEATURE_AUTOWIDTH
|
#ifdef CONFIG_FEATURE_AUTOWIDTH
|
||||||
static inline void to_naws(void)
|
static void to_naws(void)
|
||||||
{
|
{
|
||||||
/* Tell server we will do NAWS */
|
/* Tell server we will do NAWS */
|
||||||
putiac2(WILL, TELOPT_NAWS);
|
putiac2(WILL, TELOPT_NAWS);
|
||||||
|
@ -173,7 +173,7 @@ bad:
|
|||||||
/**
|
/**
|
||||||
* Return milliseconds of random delay, up to "secs" seconds.
|
* Return milliseconds of random delay, up to "secs" seconds.
|
||||||
*/
|
*/
|
||||||
static inline unsigned ms_rdelay(unsigned secs)
|
static unsigned ATTRIBUTE_ALWAYS_INLINE ms_rdelay(unsigned secs)
|
||||||
{
|
{
|
||||||
return lrand48() % (secs * 1000);
|
return lrand48() % (secs * 1000);
|
||||||
}
|
}
|
||||||
|
89
shell/ash.c
89
shell/ash.c
@ -1591,7 +1591,7 @@ static int varcmp(const char *, const char *);
|
|||||||
static struct var **hashvar(const char *);
|
static struct var **hashvar(const char *);
|
||||||
|
|
||||||
|
|
||||||
static inline int varequal(const char *a, const char *b) {
|
static int varequal(const char *a, const char *b) {
|
||||||
return !varcmp(a, b);
|
return !varcmp(a, b);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1649,8 +1649,7 @@ static void out2str(const char *p)
|
|||||||
* This routine initializes the builtin variables.
|
* This routine initializes the builtin variables.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static inline void
|
static void initvar(void)
|
||||||
initvar(void)
|
|
||||||
{
|
{
|
||||||
struct var *vp;
|
struct var *vp;
|
||||||
struct var *end;
|
struct var *end;
|
||||||
@ -1674,8 +1673,7 @@ initvar(void)
|
|||||||
} while (++vp < end);
|
} while (++vp < end);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void
|
static void init(void)
|
||||||
init(void)
|
|
||||||
{
|
{
|
||||||
|
|
||||||
/* from input.c: */
|
/* from input.c: */
|
||||||
@ -1860,7 +1858,7 @@ static char *stnputs(const char *, size_t, char *);
|
|||||||
static char *stputs(const char *, char *);
|
static char *stputs(const char *, char *);
|
||||||
|
|
||||||
|
|
||||||
static inline char *_STPUTC(int c, char *p) {
|
static char *_STPUTC(int c, char *p) {
|
||||||
if (p == sstrend)
|
if (p == sstrend)
|
||||||
p = growstackstr();
|
p = growstackstr();
|
||||||
*p++ = c;
|
*p++ = c;
|
||||||
@ -2354,8 +2352,7 @@ out:
|
|||||||
* cd command.
|
* cd command.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static inline const char *
|
static const char * updatepwd(const char *dir)
|
||||||
updatepwd(const char *dir)
|
|
||||||
{
|
{
|
||||||
char *new;
|
char *new;
|
||||||
char *p;
|
char *p;
|
||||||
@ -2444,8 +2441,7 @@ out:
|
|||||||
* Find out what the current directory is. If we already know the current
|
* Find out what the current directory is. If we already know the current
|
||||||
* directory, this routine returns immediately.
|
* directory, this routine returns immediately.
|
||||||
*/
|
*/
|
||||||
static inline char *
|
static char * getpwd(void)
|
||||||
getpwd(void)
|
|
||||||
{
|
{
|
||||||
char *dir = getcwd(0, 0);
|
char *dir = getcwd(0, 0);
|
||||||
return dir ? dir : nullstr;
|
return dir ? dir : nullstr;
|
||||||
@ -3167,8 +3163,7 @@ out:
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_ASH_CMDCMD
|
#ifdef CONFIG_ASH_CMDCMD
|
||||||
static inline char **
|
static char ** parse_command_args(char **argv, const char **path)
|
||||||
parse_command_args(char **argv, const char **path)
|
|
||||||
{
|
{
|
||||||
char *cp, c;
|
char *cp, c;
|
||||||
|
|
||||||
@ -3199,8 +3194,7 @@ parse_command_args(char **argv, const char **path)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static inline int
|
static int isassignment(const char *p)
|
||||||
isassignment(const char *p)
|
|
||||||
{
|
{
|
||||||
const char *q = endofname(p);
|
const char *q = endofname(p);
|
||||||
if (p == q)
|
if (p == q)
|
||||||
@ -3520,8 +3514,7 @@ funcdone:
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static inline int
|
static int goodname(const char *p)
|
||||||
goodname(const char *p)
|
|
||||||
{
|
{
|
||||||
return !*endofname(p);
|
return !*endofname(p);
|
||||||
}
|
}
|
||||||
@ -4245,8 +4238,7 @@ delete_cmd_entry(void)
|
|||||||
* the same name - except special builtins.
|
* the same name - except special builtins.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static inline void
|
static void addcmdentry(char *name, struct cmdentry *entry)
|
||||||
addcmdentry(char *name, struct cmdentry *entry)
|
|
||||||
{
|
{
|
||||||
struct tblentry *cmdp;
|
struct tblentry *cmdp;
|
||||||
|
|
||||||
@ -4263,8 +4255,7 @@ addcmdentry(char *name, struct cmdentry *entry)
|
|||||||
* Make a copy of a parse tree.
|
* Make a copy of a parse tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static inline struct funcnode *
|
static struct funcnode * copyfunc(union node *n)
|
||||||
copyfunc(union node *n)
|
|
||||||
{
|
{
|
||||||
struct funcnode *f;
|
struct funcnode *f;
|
||||||
size_t blocksize;
|
size_t blocksize;
|
||||||
@ -4529,8 +4520,7 @@ static void varunset(const char *, const char *, const char *, int)
|
|||||||
* Returns an stalloced string.
|
* Returns an stalloced string.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static inline char *
|
static char * preglob(const char *pattern, int quoted, int flag) {
|
||||||
preglob(const char *pattern, int quoted, int flag) {
|
|
||||||
flag |= RMESCAPE_GLOB;
|
flag |= RMESCAPE_GLOB;
|
||||||
if (quoted) {
|
if (quoted) {
|
||||||
flag |= RMESCAPE_QUOTED;
|
flag |= RMESCAPE_QUOTED;
|
||||||
@ -4554,8 +4544,7 @@ esclen(const char *start, const char *p) {
|
|||||||
* Expand shell variables and backquotes inside a here document.
|
* Expand shell variables and backquotes inside a here document.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static inline void
|
static void expandhere(union node *arg, int fd)
|
||||||
expandhere(union node *arg, int fd)
|
|
||||||
{
|
{
|
||||||
herefd = fd;
|
herefd = fd;
|
||||||
expandarg(arg, (struct arglist *)NULL, 0);
|
expandarg(arg, (struct arglist *)NULL, 0);
|
||||||
@ -5783,8 +5772,7 @@ msort(struct strlist *list, int len)
|
|||||||
* Returns true if the pattern matches the string.
|
* Returns true if the pattern matches the string.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static inline int
|
static int patmatch(char *pattern, const char *string)
|
||||||
patmatch(char *pattern, const char *string)
|
|
||||||
{
|
{
|
||||||
return pmatch(preglob(pattern, 0, 0), string);
|
return pmatch(preglob(pattern, 0, 0), string);
|
||||||
}
|
}
|
||||||
@ -5967,7 +5955,7 @@ static int pgetc2(void)
|
|||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
static inline int pgetc2(void)
|
static int pgetc2(void)
|
||||||
{
|
{
|
||||||
return pgetc_macro();
|
return pgetc_macro();
|
||||||
}
|
}
|
||||||
@ -5977,8 +5965,7 @@ static inline int pgetc2(void)
|
|||||||
* Read a line from the script.
|
* Read a line from the script.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static inline char *
|
static char * pfgets(char *line, int len)
|
||||||
pfgets(char *line, int len)
|
|
||||||
{
|
{
|
||||||
char *p = line;
|
char *p = line;
|
||||||
int nleft = len;
|
int nleft = len;
|
||||||
@ -6007,7 +5994,7 @@ static char *cmdedit_prompt;
|
|||||||
#else
|
#else
|
||||||
static const char *cmdedit_prompt;
|
static const char *cmdedit_prompt;
|
||||||
#endif
|
#endif
|
||||||
static inline void putprompt(const char *s)
|
static void putprompt(const char *s)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_ASH_EXPAND_PRMT
|
#ifdef CONFIG_ASH_EXPAND_PRMT
|
||||||
free(cmdedit_prompt);
|
free(cmdedit_prompt);
|
||||||
@ -6017,14 +6004,13 @@ static inline void putprompt(const char *s)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
static inline void putprompt(const char *s)
|
static void putprompt(const char *s)
|
||||||
{
|
{
|
||||||
out2str(s);
|
out2str(s);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static inline int
|
static int preadfd(void)
|
||||||
preadfd(void)
|
|
||||||
{
|
{
|
||||||
int nr;
|
int nr;
|
||||||
char *buf = parsefile->buf;
|
char *buf = parsefile->buf;
|
||||||
@ -7120,8 +7106,7 @@ growjobtab(void)
|
|||||||
* Called with interrupts off.
|
* Called with interrupts off.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static inline void
|
static void forkchild(struct job *jp, union node *n, int mode)
|
||||||
forkchild(struct job *jp, union node *n, int mode)
|
|
||||||
{
|
{
|
||||||
int oldlvl;
|
int oldlvl;
|
||||||
|
|
||||||
@ -7168,8 +7153,7 @@ forkchild(struct job *jp, union node *n, int mode)
|
|||||||
jobless = 0;
|
jobless = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void
|
static void forkparent(struct job *jp, union node *n, int mode, pid_t pid)
|
||||||
forkparent(struct job *jp, union node *n, int mode, pid_t pid)
|
|
||||||
{
|
{
|
||||||
TRACE(("In parent shell: child = %d\n", pid));
|
TRACE(("In parent shell: child = %d\n", pid));
|
||||||
if (!jp) {
|
if (!jp) {
|
||||||
@ -7306,8 +7290,7 @@ waitforjob(struct job *jp)
|
|||||||
* and the jobs command may give out of date information.
|
* and the jobs command may give out of date information.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static inline int
|
static int waitproc(int block, int *status)
|
||||||
waitproc(int block, int *status)
|
|
||||||
{
|
{
|
||||||
int flags = 0;
|
int flags = 0;
|
||||||
|
|
||||||
@ -8071,8 +8054,7 @@ readcmdfile(char *name)
|
|||||||
* search for the file, which is necessary to find sub-commands.
|
* search for the file, which is necessary to find sub-commands.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static inline char *
|
static char * find_dot_file(char *name)
|
||||||
find_dot_file(char *name)
|
|
||||||
{
|
{
|
||||||
char *fullname;
|
char *fullname;
|
||||||
const char *path = pathval();
|
const char *path = pathval();
|
||||||
@ -8347,8 +8329,7 @@ growstackblock(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void
|
static void grabstackblock(size_t len)
|
||||||
grabstackblock(size_t len)
|
|
||||||
{
|
{
|
||||||
len = SHELL_ALIGN(len);
|
len = SHELL_ALIGN(len);
|
||||||
stacknxt += len;
|
stacknxt += len;
|
||||||
@ -8830,8 +8811,7 @@ optschanged(void)
|
|||||||
setvimode(viflag);
|
setvimode(viflag);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void
|
static void minus_o(char *name, int val)
|
||||||
minus_o(char *name, int val)
|
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@ -10902,8 +10882,7 @@ static const char *const *findkwd(const char *s)
|
|||||||
* Open a file in noclobber mode.
|
* Open a file in noclobber mode.
|
||||||
* The code was copied from bash.
|
* The code was copied from bash.
|
||||||
*/
|
*/
|
||||||
static inline int
|
static int noclobberopen(const char *fname)
|
||||||
noclobberopen(const char *fname)
|
|
||||||
{
|
{
|
||||||
int r, fd;
|
int r, fd;
|
||||||
struct stat finfo, finfo2;
|
struct stat finfo, finfo2;
|
||||||
@ -10962,8 +10941,7 @@ noclobberopen(const char *fname)
|
|||||||
* the pipe without forking.
|
* the pipe without forking.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static inline int
|
static int openhere(union node *redir)
|
||||||
openhere(union node *redir)
|
|
||||||
{
|
{
|
||||||
int pip[2];
|
int pip[2];
|
||||||
size_t len = 0;
|
size_t len = 0;
|
||||||
@ -11055,8 +11033,7 @@ eopen:
|
|||||||
sh_error("cannot open %s: %s", fname, errmsg(errno, E_OPEN));
|
sh_error("cannot open %s: %s", fname, errmsg(errno, E_OPEN));
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void
|
static void dupredirect(union node *redir, int f)
|
||||||
dupredirect(union node *redir, int f)
|
|
||||||
{
|
{
|
||||||
int fd = redir->nfile.fd;
|
int fd = redir->nfile.fd;
|
||||||
|
|
||||||
@ -12231,8 +12208,7 @@ exportcmd(int argc, char **argv)
|
|||||||
* "-" as a special case.
|
* "-" as a special case.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static inline void
|
static void mklocal(char *name)
|
||||||
mklocal(char *name)
|
|
||||||
{
|
{
|
||||||
struct localvar *lvp;
|
struct localvar *lvp;
|
||||||
struct var **vpp;
|
struct var **vpp;
|
||||||
@ -13186,7 +13162,7 @@ typedef unsigned char operator;
|
|||||||
|
|
||||||
#define NUMPTR (*numstackptr)
|
#define NUMPTR (*numstackptr)
|
||||||
|
|
||||||
static inline int tok_have_assign(operator op)
|
static int tok_have_assign(operator op)
|
||||||
{
|
{
|
||||||
operator prec = PREC(op);
|
operator prec = PREC(op);
|
||||||
|
|
||||||
@ -13195,7 +13171,7 @@ static inline int tok_have_assign(operator op)
|
|||||||
prec == PREC_PRE || prec == PREC_POST);
|
prec == PREC_PRE || prec == PREC_POST);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int is_right_associativity(operator prec)
|
static int is_right_associativity(operator prec)
|
||||||
{
|
{
|
||||||
return (prec == PREC(TOK_ASSIGN) || prec == PREC(TOK_EXPONENT) ||
|
return (prec == PREC(TOK_ASSIGN) || prec == PREC(TOK_EXPONENT) ||
|
||||||
prec == PREC(TOK_CONDITIONAL));
|
prec == PREC(TOK_CONDITIONAL));
|
||||||
@ -13258,8 +13234,7 @@ static int arith_lookup_val(v_n_t *t)
|
|||||||
/* "applying" a token means performing it on the top elements on the integer
|
/* "applying" a token means performing it on the top elements on the integer
|
||||||
* stack. For a unary operator it will only change the top element, but a
|
* stack. For a unary operator it will only change the top element, but a
|
||||||
* binary operator will pop two arguments and push a result */
|
* binary operator will pop two arguments and push a result */
|
||||||
static inline int
|
static int arith_apply(operator op, v_n_t *numstack, v_n_t **numstackptr)
|
||||||
arith_apply(operator op, v_n_t *numstack, v_n_t **numstackptr)
|
|
||||||
{
|
{
|
||||||
v_n_t *numptr_m1;
|
v_n_t *numptr_m1;
|
||||||
arith_t numptr_val, rez;
|
arith_t numptr_val, rez;
|
||||||
|
@ -247,13 +247,13 @@ static void goto_new_line(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static inline void out1str(const char *s)
|
static void out1str(const char *s)
|
||||||
{
|
{
|
||||||
if ( s )
|
if ( s )
|
||||||
fputs(s, stdout);
|
fputs(s, stdout);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void beep(void)
|
static void beep(void)
|
||||||
{
|
{
|
||||||
putchar('\007');
|
putchar('\007');
|
||||||
}
|
}
|
||||||
|
42
shell/hush.c
42
shell/hush.c
@ -285,7 +285,7 @@ struct built_in_command {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/* belongs in busybox.h */
|
/* belongs in busybox.h */
|
||||||
static inline int max(int a, int b) {
|
static int max(int a, int b) {
|
||||||
return (a>b)?a:b;
|
return (a>b)?a:b;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -298,8 +298,14 @@ static void debug_printf(const char *format, ...)
|
|||||||
vfprintf(stderr, format, args);
|
vfprintf(stderr, format, args);
|
||||||
va_end(args);
|
va_end(args);
|
||||||
}
|
}
|
||||||
|
/* broken, of course, but OK for testing */
|
||||||
|
static char *indenter(int i)
|
||||||
|
{
|
||||||
|
static char blanks[]=" ";
|
||||||
|
return &blanks[sizeof(blanks)-i-1];
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
static inline void debug_printf(const char *format ATTRIBUTE_UNUSED, ...) { }
|
#define debug_printf(...) do {;} while(0);
|
||||||
#endif
|
#endif
|
||||||
#define final_printf debug_printf
|
#define final_printf debug_printf
|
||||||
|
|
||||||
@ -345,7 +351,6 @@ static void mark_open(int fd);
|
|||||||
static void mark_closed(int fd);
|
static void mark_closed(int fd);
|
||||||
static void close_all(void);
|
static void close_all(void);
|
||||||
/* "run" the final data structures: */
|
/* "run" the final data structures: */
|
||||||
static char *indenter(int i);
|
|
||||||
static int free_pipe_list(struct pipe *head, int indent);
|
static int free_pipe_list(struct pipe *head, int indent);
|
||||||
static int free_pipe(struct pipe *pi, int indent);
|
static int free_pipe(struct pipe *pi, int indent);
|
||||||
/* really run the final data structures: */
|
/* really run the final data structures: */
|
||||||
@ -847,7 +852,7 @@ static int static_peek(struct in_str *i)
|
|||||||
return *i->p;
|
return *i->p;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void cmdedit_set_initial_prompt(void)
|
static void cmdedit_set_initial_prompt(void)
|
||||||
{
|
{
|
||||||
#ifndef CONFIG_FEATURE_SH_FANCY_PROMPT
|
#ifndef CONFIG_FEATURE_SH_FANCY_PROMPT
|
||||||
PS1 = NULL;
|
PS1 = NULL;
|
||||||
@ -858,7 +863,7 @@ static inline void cmdedit_set_initial_prompt(void)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void setup_prompt_string(int promptmode, char **prompt_str)
|
static void setup_prompt_string(int promptmode, char **prompt_str)
|
||||||
{
|
{
|
||||||
debug_printf("setup_prompt_string %d ",promptmode);
|
debug_printf("setup_prompt_string %d ",promptmode);
|
||||||
#ifndef CONFIG_FEATURE_SH_FANCY_PROMPT
|
#ifndef CONFIG_FEATURE_SH_FANCY_PROMPT
|
||||||
@ -1591,13 +1596,6 @@ static int run_list_real(struct pipe *pi)
|
|||||||
return rcode;
|
return rcode;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* broken, of course, but OK for testing */
|
|
||||||
static char *indenter(int i)
|
|
||||||
{
|
|
||||||
static char blanks[]=" ";
|
|
||||||
return &blanks[sizeof(blanks)-i-1];
|
|
||||||
}
|
|
||||||
|
|
||||||
/* return code is the exit status of the pipe */
|
/* return code is the exit status of the pipe */
|
||||||
static int free_pipe(struct pipe *pi, int indent)
|
static int free_pipe(struct pipe *pi, int indent)
|
||||||
{
|
{
|
||||||
@ -1605,29 +1603,28 @@ static int free_pipe(struct pipe *pi, int indent)
|
|||||||
struct child_prog *child;
|
struct child_prog *child;
|
||||||
struct redir_struct *r, *rnext;
|
struct redir_struct *r, *rnext;
|
||||||
int a, i, ret_code=0;
|
int a, i, ret_code=0;
|
||||||
char *ind = indenter(indent);
|
|
||||||
|
|
||||||
if (pi->stopped_progs > 0)
|
if (pi->stopped_progs > 0)
|
||||||
return ret_code;
|
return ret_code;
|
||||||
final_printf("%s run pipe: (pid %d)\n",ind,getpid());
|
final_printf("%s run pipe: (pid %d)\n",indenter(indent),getpid());
|
||||||
for (i=0; i<pi->num_progs; i++) {
|
for (i=0; i<pi->num_progs; i++) {
|
||||||
child = &pi->progs[i];
|
child = &pi->progs[i];
|
||||||
final_printf("%s command %d:\n",ind,i);
|
final_printf("%s command %d:\n",indenter(indent),i);
|
||||||
if (child->argv) {
|
if (child->argv) {
|
||||||
for (a=0,p=child->argv; *p; a++,p++) {
|
for (a=0,p=child->argv; *p; a++,p++) {
|
||||||
final_printf("%s argv[%d] = %s\n",ind,a,*p);
|
final_printf("%s argv[%d] = %s\n",indenter(indent),a,*p);
|
||||||
}
|
}
|
||||||
globfree(&child->glob_result);
|
globfree(&child->glob_result);
|
||||||
child->argv=NULL;
|
child->argv=NULL;
|
||||||
} else if (child->group) {
|
} else if (child->group) {
|
||||||
final_printf("%s begin group (subshell:%d)\n",ind, child->subshell);
|
final_printf("%s begin group (subshell:%d)\n",indenter(indent), child->subshell);
|
||||||
ret_code = free_pipe_list(child->group,indent+3);
|
ret_code = free_pipe_list(child->group,indent+3);
|
||||||
final_printf("%s end group\n",ind);
|
final_printf("%s end group\n",indenter(indent));
|
||||||
} else {
|
} else {
|
||||||
final_printf("%s (nil)\n",ind);
|
final_printf("%s (nil)\n",indenter(indent));
|
||||||
}
|
}
|
||||||
for (r=child->redirects; r; r=rnext) {
|
for (r=child->redirects; r; r=rnext) {
|
||||||
final_printf("%s redirect %d%s", ind, r->fd, redir_table[r->type].descrip);
|
final_printf("%s redirect %d%s", indenter(indent), r->fd, redir_table[r->type].descrip);
|
||||||
if (r->dup == -1) {
|
if (r->dup == -1) {
|
||||||
/* guard against the case >$FOO, where foo is unset or blank */
|
/* guard against the case >$FOO, where foo is unset or blank */
|
||||||
if (r->word.gl_pathv) {
|
if (r->word.gl_pathv) {
|
||||||
@ -1651,11 +1648,10 @@ static int free_pipe_list(struct pipe *head, int indent)
|
|||||||
{
|
{
|
||||||
int rcode=0; /* if list has no members */
|
int rcode=0; /* if list has no members */
|
||||||
struct pipe *pi, *next;
|
struct pipe *pi, *next;
|
||||||
char *ind = indenter(indent);
|
|
||||||
for (pi=head; pi; pi=next) {
|
for (pi=head; pi; pi=next) {
|
||||||
final_printf("%s pipe reserved mode %d\n", ind, pi->r_mode);
|
final_printf("%s pipe reserved mode %d\n", indenter(indent), pi->r_mode);
|
||||||
rcode = free_pipe(pi, indent);
|
rcode = free_pipe(pi, indent);
|
||||||
final_printf("%s pipe followup code %d\n", ind, pi->followup);
|
final_printf("%s pipe followup code %d\n", indenter(indent), pi->followup);
|
||||||
next=pi->next;
|
next=pi->next;
|
||||||
pi->next=NULL;
|
pi->next=NULL;
|
||||||
free(pi);
|
free(pi);
|
||||||
|
@ -46,7 +46,7 @@ static void interrupted(int sig);
|
|||||||
/*
|
/*
|
||||||
* sem_up - up()'s a semaphore.
|
* sem_up - up()'s a semaphore.
|
||||||
*/
|
*/
|
||||||
static inline void sem_up(int semid)
|
static void sem_up(int semid)
|
||||||
{
|
{
|
||||||
if ( semop(semid, SMrup, 1) == -1 )
|
if ( semop(semid, SMrup, 1) == -1 )
|
||||||
error_exit("semop[SMrup]");
|
error_exit("semop[SMrup]");
|
||||||
@ -55,7 +55,7 @@ static inline void sem_up(int semid)
|
|||||||
/*
|
/*
|
||||||
* sem_down - down()'s a semaphore
|
* sem_down - down()'s a semaphore
|
||||||
*/
|
*/
|
||||||
static inline void sem_down(int semid)
|
static void sem_down(int semid)
|
||||||
{
|
{
|
||||||
if ( semop(semid, SMrdn, 2) == -1 )
|
if ( semop(semid, SMrdn, 2) == -1 )
|
||||||
error_exit("semop[SMrdn]");
|
error_exit("semop[SMrdn]");
|
||||||
|
@ -1631,13 +1631,13 @@ alpha_bootblock_checksum(char *boot)
|
|||||||
#endif /* OSF_LABEL */
|
#endif /* OSF_LABEL */
|
||||||
|
|
||||||
#if defined(CONFIG_FEATURE_SGI_LABEL) || defined(CONFIG_FEATURE_SUN_LABEL)
|
#if defined(CONFIG_FEATURE_SGI_LABEL) || defined(CONFIG_FEATURE_SUN_LABEL)
|
||||||
static inline unsigned short
|
static unsigned short
|
||||||
__swap16(unsigned short x)
|
__swap16(unsigned short x)
|
||||||
{
|
{
|
||||||
return (((uint16_t)(x) & 0xFF) << 8) | (((uint16_t)(x) & 0xFF00) >> 8);
|
return (((uint16_t)(x) & 0xFF) << 8) | (((uint16_t)(x) & 0xFF00) >> 8);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline uint32_t
|
static uint32_t
|
||||||
__swap32(uint32_t x)
|
__swap32(uint32_t x)
|
||||||
{
|
{
|
||||||
return (((x & 0xFF) << 24) |
|
return (((x & 0xFF) << 24) |
|
||||||
@ -3919,7 +3919,7 @@ get_sectorsize(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void
|
static void
|
||||||
get_kernel_geometry(void)
|
get_kernel_geometry(void)
|
||||||
{
|
{
|
||||||
struct hd_geometry geometry;
|
struct hd_geometry geometry;
|
||||||
|
@ -247,7 +247,7 @@ static void recursive_check(unsigned int ino);
|
|||||||
static void recursive_check2(unsigned int ino);
|
static void recursive_check2(unsigned int ino);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static inline int bit(char *a, unsigned int i)
|
static int bit(char *a, unsigned int i)
|
||||||
{
|
{
|
||||||
return (a[i >> 3] & (1<<(i & 7))) != 0;
|
return (a[i >> 3] & (1<<(i & 7))) != 0;
|
||||||
}
|
}
|
||||||
@ -282,7 +282,7 @@ static char *name_component[MAX_DEPTH+1];
|
|||||||
|
|
||||||
/* Wed Feb 9 15:17:06 MST 2000 */
|
/* Wed Feb 9 15:17:06 MST 2000 */
|
||||||
/* dynamically allocate name_list (instead of making it static) */
|
/* dynamically allocate name_list (instead of making it static) */
|
||||||
static inline void alloc_current_name(void)
|
static void alloc_current_name(void)
|
||||||
{
|
{
|
||||||
current_name = xmalloc(MAX_DEPTH * (BUFSIZ + 1));
|
current_name = xmalloc(MAX_DEPTH * (BUFSIZ + 1));
|
||||||
current_name[0] = '/';
|
current_name[0] = '/';
|
||||||
@ -293,7 +293,7 @@ static inline void alloc_current_name(void)
|
|||||||
#ifdef CONFIG_FEATURE_CLEAN_UP
|
#ifdef CONFIG_FEATURE_CLEAN_UP
|
||||||
/* execute this atexit() to deallocate name_list[] */
|
/* execute this atexit() to deallocate name_list[] */
|
||||||
/* piptigger was here */
|
/* piptigger was here */
|
||||||
static inline void free_current_name(void)
|
static void free_current_name(void)
|
||||||
{
|
{
|
||||||
free(current_name);
|
free(current_name);
|
||||||
}
|
}
|
||||||
|
@ -222,7 +222,7 @@ static unsigned short good_blocks_table[MAX_GOOD_BLOCKS];
|
|||||||
static int used_good_blocks;
|
static int used_good_blocks;
|
||||||
static unsigned long req_nr_inodes;
|
static unsigned long req_nr_inodes;
|
||||||
|
|
||||||
static inline int bit(char * a,unsigned int i)
|
static int bit(char * a,unsigned int i)
|
||||||
{
|
{
|
||||||
return (a[i >> 3] & (1<<(i & 7))) != 0;
|
return (a[i >> 3] & (1<<(i & 7))) != 0;
|
||||||
}
|
}
|
||||||
@ -240,7 +240,7 @@ static inline int bit(char * a,unsigned int i)
|
|||||||
* an already mounted partition. Code adapted from mke2fs, Copyright
|
* an already mounted partition. Code adapted from mke2fs, Copyright
|
||||||
* (C) 1994 Theodore Ts'o. Also licensed under GPL.
|
* (C) 1994 Theodore Ts'o. Also licensed under GPL.
|
||||||
*/
|
*/
|
||||||
static inline void check_mount(void)
|
static void check_mount(void)
|
||||||
{
|
{
|
||||||
FILE *f;
|
FILE *f;
|
||||||
struct mntent *mnt;
|
struct mntent *mnt;
|
||||||
@ -268,7 +268,7 @@ static long valid_offset(int fd, int offset)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int count_blocks(int fd)
|
static int count_blocks(int fd)
|
||||||
{
|
{
|
||||||
int high, low;
|
int high, low;
|
||||||
|
|
||||||
@ -287,7 +287,7 @@ static inline int count_blocks(int fd)
|
|||||||
return (low + 1);
|
return (low + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int get_size(const char *file)
|
static int get_size(const char *file)
|
||||||
{
|
{
|
||||||
int fd;
|
int fd;
|
||||||
long size;
|
long size;
|
||||||
@ -303,7 +303,7 @@ static inline int get_size(const char *file)
|
|||||||
return size;
|
return size;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void write_tables(void)
|
static void write_tables(void)
|
||||||
{
|
{
|
||||||
/* Mark the super block valid. */
|
/* Mark the super block valid. */
|
||||||
Super.s_state |= MINIX_VALID_FS;
|
Super.s_state |= MINIX_VALID_FS;
|
||||||
@ -353,7 +353,7 @@ static int get_free_block(void)
|
|||||||
return blk;
|
return blk;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void mark_good_blocks(void)
|
static void mark_good_blocks(void)
|
||||||
{
|
{
|
||||||
int blk;
|
int blk;
|
||||||
|
|
||||||
@ -371,7 +371,7 @@ static int next(int zone)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void make_bad_inode(void)
|
static void make_bad_inode(void)
|
||||||
{
|
{
|
||||||
struct minix_inode *inode = &Inode[MINIX_BAD_INO];
|
struct minix_inode *inode = &Inode[MINIX_BAD_INO];
|
||||||
int i, j, zone;
|
int i, j, zone;
|
||||||
@ -422,7 +422,7 @@ static inline void make_bad_inode(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_FEATURE_MINIX2
|
#ifdef CONFIG_FEATURE_MINIX2
|
||||||
static inline void make_bad_inode2(void)
|
static void make_bad_inode2(void)
|
||||||
{
|
{
|
||||||
struct minix2_inode *inode = &Inode2[MINIX_BAD_INO];
|
struct minix2_inode *inode = &Inode2[MINIX_BAD_INO];
|
||||||
int i, j, zone;
|
int i, j, zone;
|
||||||
@ -472,7 +472,7 @@ static inline void make_bad_inode2(void)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static inline void make_root_inode(void)
|
static void make_root_inode(void)
|
||||||
{
|
{
|
||||||
struct minix_inode *inode = &Inode[MINIX_ROOT_INO];
|
struct minix_inode *inode = &Inode[MINIX_ROOT_INO];
|
||||||
|
|
||||||
@ -495,7 +495,7 @@ static inline void make_root_inode(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_FEATURE_MINIX2
|
#ifdef CONFIG_FEATURE_MINIX2
|
||||||
static inline void make_root_inode2(void)
|
static void make_root_inode2(void)
|
||||||
{
|
{
|
||||||
struct minix2_inode *inode = &Inode2[MINIX_ROOT_INO];
|
struct minix2_inode *inode = &Inode2[MINIX_ROOT_INO];
|
||||||
|
|
||||||
@ -518,7 +518,7 @@ static inline void make_root_inode2(void)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static inline void setup_tables(void)
|
static void setup_tables(void)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
unsigned long inodes;
|
unsigned long inodes;
|
||||||
@ -594,7 +594,7 @@ static inline void setup_tables(void)
|
|||||||
* Perform a test of a block; return the number of
|
* Perform a test of a block; return the number of
|
||||||
* blocks readable/writable.
|
* blocks readable/writable.
|
||||||
*/
|
*/
|
||||||
static inline long do_check(char *buffer, int try, unsigned int current_block)
|
static long do_check(char *buffer, int try, unsigned int current_block)
|
||||||
{
|
{
|
||||||
long got;
|
long got;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user