# To compile vs uClibc, just use the compiler wrapper built by uClibc...
# Everything should compile and work as expected these days...
-#CC = ../uClibc/extra/gcc-uClibc/i386-uclibc-gcc
+#CC = /usr/i386-linux-uclibc/usr/bin/i386-uclibc-gcc
# To compile vs some other alternative libc, you may need to use/adjust
# the following lines to meet your needs...
OPTIMIZATION := $(shell if $(CC) -Os -S -o /dev/null -xc /dev/null >/dev/null 2>&1; \
then echo "-Os"; else echo "-O2" ; fi)
-WARNINGS = -Wall -Wshadow
-
+WARNINGS=-Wall -Wstrict-prototypes -Wshadow
ARFLAGS = -r
#
bytes_in = 0L;
}
-static void write_error_msg()
+static void write_error_msg(void)
{
fprintf(stderr, "\n");
perror("");
* Signal and error handler.
*/
-static void abort_gzip()
+static void abort_gzip(void)
{
error_msg("gzip aborted\n");
exit(ERROR);
}
-static void make_crc_table()
+static void make_crc_table(void)
{
unsigned long table_entry; /* crc shift register */
unsigned long poly = 0; /* polynomial exclusive-or pattern */
*
* GLOBAL VARIABLES: outcnt, bk, bb, hufts, inptr
*/
-static int inflate()
+static int inflate(void)
{
int e; /* last block flag */
int r; /* result code */
* Signal and error handler.
*/
-static void abort_gzip()
+static void abort_gzip(void)
{
error_msg("gzip aborted\n");
exit(ERROR);
}
-static void make_crc_table()
+static void make_crc_table(void)
{
unsigned long table_entry; /* crc shift register */
unsigned long poly = 0; /* polynomial exclusive-or pattern */
*
* GLOBAL VARIABLES: outcnt, bk, bb, hufts, inptr
*/
-static int inflate()
+static int inflate(void)
{
int e; /* last block flag */
int r; /* result code */
* of all the rest.)
*/
-static inline void
-evalpipe(n)
- union node *n;
+static inline void evalpipe(union node *n)
{
struct job *jp;
struct nodelist *lp;
* PEOF may be pushed back.
*/
-static void
-pungetc() {
+static void pungetc(void)
+{
parsenleft++;
parsenextc--;
}
* after a fork is done.
*/
-static void
-closescript() {
+static void closescript(void)
+{
popallfiles();
if (parsefile->fd > 0) {
close(parsefile->fd);
* interrupts off.
*/
-static void
-setinputfd(fd, push)
- int fd, push;
+static void setinputfd(int fd, int push)
{
(void) fcntl(fd, F_SETFD, FD_CLOEXEC);
if (push) {
* input string.
*/
-static inline char *
-evalvar(p, flag)
- char *p;
- int flag;
+static inline char * evalvar(char *p, int flag)
{
int subtype;
int varflags;
#ifdef ASH_ALIAS
static int
-pgetc2()
+pgetc2(void)
{
int c;
do {
/* Return true if fd 0 has already been redirected at least once. */
static inline int
-fd0_redirected_p () {
+fd0_redirected_p (void)
+{
return fd0_redirected != 0;
}
static inline char *
-find_dot_file(mybasename)
- char *mybasename;
+find_dot_file(char *mybasename)
{
char *fullname;
const char *path = pathval();
/*
* Copyright (c) 1999 Herbert Xu <herbert@debian.org>
* This file contains code for the times builtin.
- * $Id: ash.c,v 1.25 2001/09/11 01:14:02 mjn3 Exp $
+ * $Id: ash.c,v 1.26 2001/10/18 04:11:38 andersen Exp $
*/
static int timescmd (int argc, char **argv)
{
taillen += len;
}
-static void tailbuf_trunc()
+static void tailbuf_trunc(void)
{
char *s;
s = memchr(tailbuf, '\n', taillen);
static gid_t *group_array = NULL;
static int ngroups;
-static enum token t_lex();
-static int oexpr();
-static int aexpr();
-static int nexpr();
-static int binop();
-static int primary();
-static int filstat();
-static int getn();
-static int newerf();
-static int olderf();
-static int equalf();
-static void syntax();
-static int test_eaccess();
-static int is_a_group_member();
-static void initialize_group_array();
+static enum token t_lex(char* s);
+static int oexpr(enum token n);
+static int aexpr(enum token n);
+static int nexpr(enum token n);
+static int binop(void);
+static int primary(enum token n);
+static int filstat(char *nm, enum token mode);
+static int getn(const char *s);
+static int newerf(const char *f1, const char *f2);
+static int olderf(const char *f1, const char *f2);
+static int equalf(const char *f1, const char *f2);
+static void syntax(const char *op, const char *msg);
+static int test_eaccess(char *path, int mode);
+static int is_a_group_member(gid_t gid);
+static void initialize_group_array(void);
extern int
test_main(int argc, char** argv)
static void
syntax(op, msg)
- char *op;
- char *msg;
+ const char *op;
+ const char *msg;
{
if (op && *op)
error_msg_and_die("%s: %s", op, msg);
/* atoi with error detection */
static int
getn(s)
- char *s;
+ const char *s;
{
char *p;
long r;
static int
newerf (f1, f2)
-char *f1, *f2;
+const char *f1, *f2;
{
struct stat b1, b2;
static int
olderf (f1, f2)
-char *f1, *f2;
+const char *f1, *f2;
{
struct stat b1, b2;
static int
equalf (f1, f2)
-char *f1, *f2;
+const char *f1, *f2;
{
struct stat b1, b2;
extern int optind; /* in unistd.h */
-extern int errno; /* for use with strerror() */
extern void xregcomp(regex_t *preg, const char *regex, int cflags); /* in busybox.h */
/* options */
extern int optind; /* in unistd.h */
-extern int errno; /* for use with strerror() */
extern void xregcomp(regex_t *preg, const char *regex, int cflags); /* in busybox.h */
/* options */
bytes_in = 0L;
}
-static void write_error_msg()
+static void write_error_msg(void)
{
fprintf(stderr, "\n");
perror("");
static void delete_initAction(initAction * action);
-static void loop_forever()
+static void loop_forever(void)
{
while (1)
sleep (1);
/* How much memory does this machine have?
Units are kBytes to avoid overflow on 4GB machines */
-static int check_free_memory()
+static int check_free_memory(void)
{
struct sysinfo info;
unsigned int result, u, s=10;
return result;
}
-static void console_init()
+static void console_init(void)
{
int fd;
int tried_devcons = 0;
/* Make sure there is enough memory to do something useful. *
* Calls "swapon -a" if needed so be sure /etc/fstab is present... */
-static void check_memory()
+static void check_memory(void)
{
struct stat statBuf;
static void delete_initAction(initAction * action);
-static void loop_forever()
+static void loop_forever(void)
{
while (1)
sleep (1);
/* How much memory does this machine have?
Units are kBytes to avoid overflow on 4GB machines */
-static int check_free_memory()
+static int check_free_memory(void)
{
struct sysinfo info;
unsigned int result, u, s=10;
return result;
}
-static void console_init()
+static void console_init(void)
{
int fd;
int tried_devcons = 0;
/* Make sure there is enough memory to do something useful. *
* Calls "swapon -a" if needed so be sure /etc/fstab is present... */
-static void check_memory()
+static void check_memory(void)
{
struct stat statBuf;
* Signal and error handler.
*/
-static void abort_gzip()
+static void abort_gzip(void)
{
error_msg("gzip aborted\n");
exit(ERROR);
}
-static void make_crc_table()
+static void make_crc_table(void)
{
unsigned long table_entry; /* crc shift register */
unsigned long poly = 0; /* polynomial exclusive-or pattern */
*
* GLOBAL VARIABLES: outcnt, bk, bb, hufts, inptr
*/
-static int inflate()
+static int inflate(void)
{
int e; /* last block flag */
int r; /* result code */
#include <stdarg.h>
#include <netdb.h>
-extern int h_errno;
-
#include <stdio.h>
#include "libbb.h"
+
extern void vherror_msg(const char *s, va_list p)
{
if(s == 0)
*/
#include <netdb.h>
-extern int h_errno;
-
#include "libbb.h"
+
struct hostent *xgethostbyname(const char *name)
{
struct hostent *retval;
unsigned int badpages[1];
} *p;
-static void init_signature_page()
+static void init_signature_page(void)
{
pagesize = getpagesize();
* of all the rest.)
*/
-static inline void
-evalpipe(n)
- union node *n;
+static inline void evalpipe(union node *n)
{
struct job *jp;
struct nodelist *lp;
* PEOF may be pushed back.
*/
-static void
-pungetc() {
+static void pungetc(void)
+{
parsenleft++;
parsenextc--;
}
* after a fork is done.
*/
-static void
-closescript() {
+static void closescript(void)
+{
popallfiles();
if (parsefile->fd > 0) {
close(parsefile->fd);
* interrupts off.
*/
-static void
-setinputfd(fd, push)
- int fd, push;
+static void setinputfd(int fd, int push)
{
(void) fcntl(fd, F_SETFD, FD_CLOEXEC);
if (push) {
* input string.
*/
-static inline char *
-evalvar(p, flag)
- char *p;
- int flag;
+static inline char * evalvar(char *p, int flag)
{
int subtype;
int varflags;
#ifdef ASH_ALIAS
static int
-pgetc2()
+pgetc2(void)
{
int c;
do {
/* Return true if fd 0 has already been redirected at least once. */
static inline int
-fd0_redirected_p () {
+fd0_redirected_p (void)
+{
return fd0_redirected != 0;
}
static inline char *
-find_dot_file(mybasename)
- char *mybasename;
+find_dot_file(char *mybasename)
{
char *fullname;
const char *path = pathval();
/*
* Copyright (c) 1999 Herbert Xu <herbert@debian.org>
* This file contains code for the times builtin.
- * $Id: ash.c,v 1.25 2001/09/11 01:14:02 mjn3 Exp $
+ * $Id: ash.c,v 1.26 2001/10/18 04:11:38 andersen Exp $
*/
static int timescmd (int argc, char **argv)
{
perror_msg_and_die(applet_name);
}
-static void do_em_all()
+static void do_em_all(void)
{
struct mntent *m;
FILE *f = setmntent("/etc/fstab", "r");
taillen += len;
}
-static void tailbuf_trunc()
+static void tailbuf_trunc(void)
{
char *s;
s = memchr(tailbuf, '\n', taillen);
static gid_t *group_array = NULL;
static int ngroups;
-static enum token t_lex();
-static int oexpr();
-static int aexpr();
-static int nexpr();
-static int binop();
-static int primary();
-static int filstat();
-static int getn();
-static int newerf();
-static int olderf();
-static int equalf();
-static void syntax();
-static int test_eaccess();
-static int is_a_group_member();
-static void initialize_group_array();
+static enum token t_lex(char* s);
+static int oexpr(enum token n);
+static int aexpr(enum token n);
+static int nexpr(enum token n);
+static int binop(void);
+static int primary(enum token n);
+static int filstat(char *nm, enum token mode);
+static int getn(const char *s);
+static int newerf(const char *f1, const char *f2);
+static int olderf(const char *f1, const char *f2);
+static int equalf(const char *f1, const char *f2);
+static void syntax(const char *op, const char *msg);
+static int test_eaccess(char *path, int mode);
+static int is_a_group_member(gid_t gid);
+static void initialize_group_array(void);
extern int
test_main(int argc, char** argv)
static void
syntax(op, msg)
- char *op;
- char *msg;
+ const char *op;
+ const char *msg;
{
if (op && *op)
error_msg_and_die("%s: %s", op, msg);
/* atoi with error detection */
static int
getn(s)
- char *s;
+ const char *s;
{
char *p;
long r;
static int
newerf (f1, f2)
-char *f1, *f2;
+const char *f1, *f2;
{
struct stat b1, b2;
static int
olderf (f1, f2)
-char *f1, *f2;
+const char *f1, *f2;
{
struct stat b1, b2;
static int
equalf (f1, f2)
-char *f1, *f2;
+const char *f1, *f2;
{
struct stat b1, b2;
unsigned int badpages[1];
} *p;
-static void init_signature_page()
+static void init_signature_page(void)
{
pagesize = getpagesize();
perror_msg_and_die(applet_name);
}
-static void do_em_all()
+static void do_em_all(void)
{
struct mntent *m;
FILE *f = setmntent("/etc/fstab", "r");