}
extractList=extractList->next;
}
- return (TRUE);
+ return EXIT_SUCCESS;
}
}
extractList=extractList->next;
}
- return (TRUE);
+ return EXIT_SUCCESS;
}
if (delInputFile == 1 && unlink(delFileName) < 0) {
perror(delFileName);
- exit(FALSE);
+ return EXIT_FAILURE;
}
}
return(exit_code);
if (unlink(delFileName) < 0) {
perror(delFileName);
- exit(FALSE);
+ exit(EXIT_FAILURE);
}
}
int tostdoutFlag = FALSE;
int firstOpt = TRUE;
int stopIt;
+ int status;
if (argc <= 1)
#ifndef BB_FEATURE_TAR_CREATE
fatalError( "This version of tar was not compiled with tar creation support.\n");
#else
- exit(writeTarFile(tarName, verboseFlag, argv, excludeList));
+ status = writeTarFile(tarName, verboseFlag, argv, excludeList);
#endif
}
if (listFlag == TRUE || extractFlag == TRUE) {
if (*argv)
extractList = argv;
- exit(readTarFile(tarName, extractFlag, listFlag, tostdoutFlag,
- verboseFlag, extractList, excludeList));
+ status = readTarFile(tarName, extractFlag, listFlag, tostdoutFlag,
+ verboseFlag, extractList, excludeList);
}
+ if (status == TRUE)
+ return EXIT_SUCCESS;
+ else
+ return EXIT_FAILURE;
+
flagError:
fatalError( "Exactly one of 'c', 'x' or 't' must be specified\n");
}
s[m-n] = '\0';
}
printf("%s\n", s);
- return(TRUE);
+ return EXIT_SUCCESS;
}
while (argc-- > 1) {
if (recursiveAction (*(++argv), recursiveFlag, FALSE, FALSE,
fileAction, fileAction, NULL) == FALSE)
- exit(FALSE);
+ return EXIT_FAILURE;
}
- exit(TRUE);
+ return EXIT_SUCCESS;
bad_group:
fatalError( "unknown group name: %s\n", groupName);
execlp(prog, prog, NULL);
#else
shell_main(argc, argv);
- exit (0);
+ return EXIT_SUCCESS;
#endif
}
fatalError("cannot execute %s: %s\n", prog, strerror(errno));
num = atoi(argv[1]);
if (ioctl(fd, VT_ACTIVATE, num)) {
perror("VT_ACTIVATE");
- exit(FALSE);
+ return EXIT_FAILURE;
}
if (ioctl(fd, VT_WAITACTIVE, num)) {
perror("VT_WAITACTIVE");
- exit(FALSE);
+ return EXIT_FAILURE;
}
- return(TRUE);
+ return EXIT_SUCCESS;
}
extern int clear_main(int argc, char **argv)
{
printf("\033[H\033[J");
- return(TRUE);
+ return EXIT_SUCCESS;
}
cmdedit_reset_term();
fprintf(stdout, "\n");
if (sig!=SIGINT)
- exit(TRUE);
+ exit(EXIT_SUCCESS);
}
/* Go to HOME position */
else
printf("%s %s differ: char %d, line %d\n", filename1, filename2,
char_pos, line_pos);
- return 1;
+ return EXIT_FAILURE;
}
char_pos++;
if (c1 == '\n')
num = atoi(argv[1]);
if (ioctl(fd, VT_ACTIVATE, num)) {
perror("VT_ACTIVATE");
- exit(FALSE);
+ return EXIT_FAILURE;
}
if (ioctl(fd, VT_WAITACTIVE, num)) {
perror("VT_WAITACTIVE");
- exit(FALSE);
+ return EXIT_FAILURE;
}
- return(TRUE);
+ return EXIT_SUCCESS;
}
extern int clear_main(int argc, char **argv)
{
printf("\033[H\033[J");
- return(TRUE);
+ return EXIT_SUCCESS;
}
/* deallocate all unused consoles */
if (ioctl(fd, VT_DISALLOCATE, 0)) {
perror("VT_DISALLOCATE");
- exit( FALSE);
+ return EXIT_FAILURE;
}
} else
printf("erik: B\n");
}
}
printf("erik: C\n");
- return( TRUE);
+ return EXIT_SUCCESS;
}
fd = open("/dev/tty0", O_RDWR);
if (fd < 0) {
errorMsg("Error opening /dev/tty0: %s\n", strerror(errno));
- return 1;
+ return EXIT_FAILURE;
}
write(1, magic, 7);
}
}
close(fd);
- return 0;
+ return EXIT_SUCCESS;
}
fd = open("/dev/tty", O_RDWR);
if (fd < 0) {
errorMsg("Error opening /dev/tty1: %s\n", strerror(errno));
- return( FALSE);
+ return EXIT_FAILURE;
}
if (screen_map_load(fd, stdin)) {
errorMsg("Error loading acm: %s\n", strerror(errno));
- return( FALSE);
+ return EXIT_FAILURE;
}
write(fd, "\033(K", 3);
- return( TRUE);
+ return EXIT_SUCCESS;
}
int screen_map_load(int fd, FILE * fp)
extern int reset_main(int argc, char **argv)
{
printf("\033c");
- return(TRUE);
+ return EXIT_SUCCESS;
}
argc -= 2;
argv += 2;
}
- return( TRUE);
+ return EXIT_SUCCESS;
}
s[m-n] = '\0';
}
printf("%s\n", s);
- return(TRUE);
+ return EXIT_SUCCESS;
}
execlp(prog, prog, NULL);
#else
shell_main(argc, argv);
- exit (0);
+ return EXIT_SUCCESS;
#endif
}
fatalError("cannot execute %s: %s\n", prog, strerror(errno));
else
printf("%s %s differ: char %d, line %d\n", filename1, filename2,
char_pos, line_pos);
- return 1;
+ return EXIT_FAILURE;
}
char_pos++;
if (c1 == '\n')
}
}
- return 0;
+ return EXIT_SUCCESS;
}
} else if (*date_fmt == '\0') {
/* Imitate what GNU 'date' does with NO format string! */
printf("\n");
- exit(TRUE);
+ return EXIT_SUCCESS;
}
/* Handle special conversions */
strftime(t_buff, 200, date_fmt, &tm_time);
printf("%s\n", t_buff);
- return(TRUE);
+ return EXIT_SUCCESS;
}
(inTotal % blockSize) != 0);
printf("%ld+%d records out\n", (long) (outTotal / blockSize),
(outTotal % blockSize) != 0);
- exit(TRUE);
+ return EXIT_SUCCESS;
usage:
usage(dd_usage);
exit(FALSE);
}
status = df(mountEntry->mnt_fsname, mountEntry->mnt_dir);
- if (status != 0)
- exit(status);
+ if (status != TRUE)
+ return EXIT_FAILURE;
argc--;
argv++;
}
- exit(TRUE);
+ return EXIT_SUCCESS;
} else {
FILE *mountTable;
struct mntent *mountEntry;
mountTable = setmntent(mtab_file, "r");
if (mountTable == 0) {
perror(mtab_file);
- exit(FALSE);
+ return EXIT_FAILURE;
}
while ((mountEntry = getmntent(mountTable))) {
endmntent(mountTable);
}
- return(TRUE);
+ return EXIT_FAILURE;
}
/*
if (s && *s)
*s = '\0';
printf("%s\n", (s)? *argv : ".");
- return(TRUE);
+ return EXIT_SUCCESS;
}
putchar(c);
c = getchar();
}
- return 0;
+ return EXIT_SUCCESS;
}
}
}
- return(0);
+ return EXIT_SUCCESS;
}
-/* $Id: du.c,v 1.25 2000/09/25 21:45:57 andersen Exp $ */
+/* $Id: du.c,v 1.26 2000/12/01 02:55:13 kraai Exp $ */
/*
Local Variables:
c-file-style: "linux"
putchar('\n');
fflush(stdout);
- return 0;
+ return EXIT_SUCCESS;
}
/*-
extern int hostid_main(int argc, char **argv)
{
printf("%lx\n", gethostid());
- return(TRUE);
+ return EXIT_SUCCESS;
}
if (argc != 2 || **(argv + 1) == '-')
usage(length_usage);
printf("%lu\n", (long)strlen(argv[1]));
- return (TRUE);
+ return EXIT_SUCCESS;
}
print_usage_message:
usage(ls_usage);
- return(FALSE);
}
if (file_type_specified && do_check) {
errorMsg("the -b and -t options are meaningless when verifying checksums\n");
- exit FALSE;
+ return EXIT_FAILURE;
}
if (n_strings > 0 && do_check) {
errorMsg("the -g and -c options are mutually exclusive\n");
- exit FALSE;
+ return EXIT_FAILURE;
}
if (status_only && !do_check) {
errorMsg("the -s option is meaningful only when verifying checksums\n");
- exit FALSE;
+ return EXIT_FAILURE;
}
if (warn && !do_check) {
errorMsg("the -w option is meaningful only when verifying checksums\n");
- exit FALSE;
+ return EXIT_FAILURE;
}
if (n_strings > 0) {
if (optind < argc) {
errorMsg("no files may be specified when using -g\n");
- exit FALSE;
+ return EXIT_FAILURE;
}
for (i = 0; i < n_strings; ++i) {
size_t cnt;
if (fclose (stdout) == EOF) {
errorMsg("write error\n");
- exit FALSE;
+ return EXIT_FAILURE;
}
if (have_read_stdin && fclose (stdin) == EOF) {
errorMsg("standard input\n");
- exit FALSE;
+ return EXIT_FAILURE;
}
- exit (err == 0 ? TRUE : FALSE);
+ if (err == 0)
+ return EXIT_SUCCESS;
+ else
+ return EXIT_FAILURE;
}
mode = 0;
if (parse_mode(*(++argv), &mode) == FALSE) {
errorMsg("Unknown mode: %s\n", *argv);
- exit FALSE;
+ return EXIT_FAILURE;
}
/* Set the umask for this process so it doesn't
* screw up whatever the user just entered. */
if (strlen(*argv) > BUFSIZ - 1) {
errorMsg(name_too_long);
- exit FALSE;
+ return EXIT_FAILURE;
}
strcpy(buf, *argv);
status = stat(buf, &statBuf);
if (parentFlag == FALSE && status != -1 && errno != ENOENT) {
errorMsg("%s: File exists\n", buf);
- exit FALSE;
+ return EXIT_FAILURE;
}
if (parentFlag == TRUE) {
strcat(buf, "/");
} else {
if (mkdir(buf, mode) != 0 && parentFlag == FALSE) {
perror(buf);
- exit FALSE;
+ return EXIT_FAILURE;
}
}
argc--;
argv++;
}
- return( TRUE);
+ return EXIT_SUCCESS;
}
usage(mkfifo_usage);
if (mkfifo(*argv, mode) < 0) {
perror("mkfifo");
- exit(255);
+ return EXIT_FAILURE;
}
- return(TRUE);
+ return EXIT_SUCCESS;
}
if (mknod(argv[0], mode, dev) != 0)
fatalError("%s: %s\n", argv[0], strerror(errno));
- return (TRUE);
+ return EXIT_SUCCESS;
}
fatalError("%s\n", strerror(errno));
printf("%s\n", buf);
- return(TRUE);
+ return EXIT_SUCCESS;
}
} else {
if (recursiveAction(srcName, recursiveFlag, FALSE,
TRUE, fileAction, dirAction, NULL) == FALSE) {
- exit(FALSE);
+ return EXIT_FAILURE;
}
}
}
- return(TRUE);
+ return EXIT_SUCCESS;
}
if (sleep(atoi(*(++argv))) != 0) {
perror("sleep");
- exit(FALSE);
+ return EXIT_FAILURE;
}
- return(TRUE);
+ return EXIT_SUCCESS;
}
break;
default:
usage(touch_usage);
- exit(FALSE);
}
}
}
S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH);
if (fd < 0) {
if (create == FALSE && errno == ENOENT)
- exit(TRUE);
+ return EXIT_SUCCESS;
else {
fatalError("%s", strerror(errno));
}
argv++;
}
- return(TRUE);
+ return EXIT_SUCCESS;
}
else
puts("not a tty");
}
- return(isatty(0) ? TRUE : FALSE);
+ return(isatty(0) ? EXIT_SUCCESS : EXIT_FAILURE);
}
print_element(PRINT_MACHINE, name.machine);
print_element(PRINT_PROCESSOR, processor);
- return(TRUE);
+ return EXIT_SUCCESS;
}
/* If the name element set in MASK is selected for printing in `toprint',
}
usleep(atoi(*(++argv))); /* return void */
- return(TRUE);
+ return EXIT_SUCCESS;
}
}
if (optind == argc)
- exit_status = decode ("stdin", outname) == 0 ? TRUE : FALSE;
+ exit_status = decode ("stdin", outname) == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
else {
- exit_status = TRUE;
+ exit_status = EXIT_SUCCESS;
do {
if (freopen (argv[optind], "r", stdin) != NULL) {
if (decode (argv[optind], outname) != 0)
exit_status = FALSE;
} else {
errorMsg("%s: %s\n", argv[optind], strerror(errno));
- exit_status = FALSE;
+ exit_status = EXIT_FAILURE;
}
optind++;
}
/* Optional first argument is input file. */
if (!freopen (argv[optind], "r", stdin) || fstat (fileno (stdin), &sb)) {
errorMsg("%s: %s\n", argv[optind], strerror(errno));
- exit FALSE;
+ return EXIT_FAILURE;
}
mode = sb.st_mode & (S_IRWXU | S_IRWXG | S_IRWXO);
optind++;
printf(trans_ptr == uu_std ? "end\n" : "====\n");
if (ferror (stdout)) {
errorMsg("Write error\n");
- exit FALSE;
+ return EXIT_FAILURE;
}
- return( TRUE);
+ return EXIT_SUCCESS;
}
/* Copyright (c) 1983 Regents of the University of California.
if (flags_memo)
*(baseDestName + baseDestLen) = '\0';
}
- return( TRUE);
+ return EXIT_SUCCESS;
exit_false:
- return( FALSE);
+ return EXIT_FAILURE;
}
/*
}
}
- return 0;
+ return EXIT_SUCCESS;
}
} else if (*date_fmt == '\0') {
/* Imitate what GNU 'date' does with NO format string! */
printf("\n");
- exit(TRUE);
+ return EXIT_SUCCESS;
}
/* Handle special conversions */
strftime(t_buff, 200, date_fmt, &tm_time);
printf("%s\n", t_buff);
- return(TRUE);
+ return EXIT_SUCCESS;
}
static void push(double a)
{
- if (pointer >= (sizeof(stack) / sizeof(*stack))) {
- errorMsg("stack overflow\n");
- exit(-1);
- } else
- stack[pointer++] = a;
+ if (pointer >= (sizeof(stack) / sizeof(*stack)))
+ fatalError("stack overflow\n");
+ stack[pointer++] = a;
}
static double pop()
{
- if (pointer == 0) {
- errorMsg("stack underflow\n");
- exit(-1);
- }
+ if (pointer == 0)
+ fatalError("stack underflow\n");
return stack[--pointer];
}
}
o++;
}
- errorMsg("%s: syntax error.\n", argument);
- exit(-1);
+ fatalError("%s: syntax error.\n", argument);
}
/* return pointer to next token in buffer and set *buffer to one char
}
}
stack_machine(0);
- return( TRUE);
+ return EXIT_SUCCESS;
}
(inTotal % blockSize) != 0);
printf("%ld+%d records out\n", (long) (outTotal / blockSize),
(outTotal % blockSize) != 0);
- exit(TRUE);
+ return EXIT_SUCCESS;
usage:
usage(dd_usage);
/* deallocate all unused consoles */
if (ioctl(fd, VT_DISALLOCATE, 0)) {
perror("VT_DISALLOCATE");
- exit( FALSE);
+ return EXIT_FAILURE;
}
} else
printf("erik: B\n");
}
}
printf("erik: C\n");
- return( TRUE);
+ return EXIT_SUCCESS;
}
exit(FALSE);
}
status = df(mountEntry->mnt_fsname, mountEntry->mnt_dir);
- if (status != 0)
- exit(status);
+ if (status != TRUE)
+ return EXIT_FAILURE;
argc--;
argv++;
}
- exit(TRUE);
+ return EXIT_SUCCESS;
} else {
FILE *mountTable;
struct mntent *mountEntry;
mountTable = setmntent(mtab_file, "r");
if (mountTable == 0) {
perror(mtab_file);
- exit(FALSE);
+ return EXIT_FAILURE;
}
while ((mountEntry = getmntent(mountTable))) {
endmntent(mountTable);
}
- return(TRUE);
+ return EXIT_FAILURE;
}
/*
if (s && *s)
*s = '\0';
printf("%s\n", (s)? *argv : ".");
- return(TRUE);
+ return EXIT_SUCCESS;
}
if (n < 0) {
goto klogctl_error;
}
- exit(TRUE);
+ return EXIT_SUCCESS;
}
if (bufsize < 4096)
}
if (lastc != '\n')
putchar('\n');
- exit(TRUE);
+ return EXIT_SUCCESS;
end:
usage(dmesg_usage);
- exit(FALSE);
+ return EXIT_FAILURE;
klogctl_error:
perror("klogctl");
- return(FALSE);
+ return EXIT_FAILURE;
}
putchar(c);
c = getchar();
}
- return 0;
+ return EXIT_SUCCESS;
}
}
}
- return(0);
+ return EXIT_SUCCESS;
}
-/* $Id: du.c,v 1.25 2000/09/25 21:45:57 andersen Exp $ */
+/* $Id: du.c,v 1.26 2000/12/01 02:55:13 kraai Exp $ */
/*
Local Variables:
c-file-style: "linux"
fd = open("/dev/tty0", O_RDWR);
if (fd < 0) {
errorMsg("Error opening /dev/tty0: %s\n", strerror(errno));
- return 1;
+ return EXIT_FAILURE;
}
write(1, magic, 7);
}
}
close(fd);
- return 0;
+ return EXIT_SUCCESS;
}
ut.ut_addr);
}
#endif
- return(TRUE);
+ return EXIT_SUCCESS;
}
putchar('\n');
fflush(stdout);
- return 0;
+ return EXIT_SUCCESS;
}
/*-
if (g_options & OPT_READMODE) {
if (!readmode(&var, modefile, mode)) {
errorMsg("Unknown video mode `%s'\n", mode);
- exit(1);
+ return EXIT_FAILURE;
}
}
/* Don't close the file, as exiting will take care of that */
/* close(fh); */
- return (TRUE);
+ return EXIT_SUCCESS;
}
fd = open(*argv, 0);
if (fd < 0) {
perror(*argv);
- exit(FALSE);
+ return EXIT_FAILURE;
}
value = ioctl(fd, FDFLUSH, 0);
if (value) {
perror(*argv);
- exit(FALSE);
+ return EXIT_FAILURE;
}
- return(TRUE);
+ return EXIT_SUCCESS;
}
if (recursiveAction(directory, TRUE, FALSE, FALSE,
fileAction, fileAction, NULL) == FALSE) {
- exit(FALSE);
+ return EXIT_FAILURE;
}
- return(TRUE);
+ return EXIT_SUCCESS;
}
if (recursiveAction(directory, TRUE, FALSE, FALSE,
fileAction, fileAction, NULL) == FALSE) {
- exit(FALSE);
+ return EXIT_FAILURE;
}
- return(TRUE);
+ return EXIT_SUCCESS;
}
printf("%6s%13ld%13ld%13ld\n", "Total:", info.totalram+info.totalswap,
(info.totalram-info.freeram)+(info.totalswap-info.freeswap),
info.freeram+info.freeswap);
- return(TRUE);
+ return EXIT_SUCCESS;
}
/* Don't bother closing. Exit does
* that, so we can save a few bytes */
/* close(f); */
- return(TRUE);
+ return EXIT_SUCCESS;
}
/*
if (delInputFile == 1 && unlink(delFileName) < 0) {
perror(delFileName);
- exit(FALSE);
+ return EXIT_FAILURE;
}
}
return(exit_code);
if (unlink(delFileName) < 0) {
perror(delFileName);
- exit(FALSE);
+ exit(EXIT_FAILURE);
}
}
extern int hostid_main(int argc, char **argv)
{
printf("%lx\n", gethostid());
- return(TRUE);
+ return EXIT_SUCCESS;
}
#ifndef MODUTILS_MODULE_H
#define MODUTILS_MODULE_H 1
-#ident "$Id: insmod.c,v 1.28 2000/10/23 18:03:46 kraai Exp $"
+#ident "$Id: insmod.c,v 1.29 2000/12/01 02:55:13 kraai Exp $"
/* This file contains the structures used by the 2.0 and 2.1 kernels.
We do not use the kernel headers directly because we do not wish
#ifndef MODUTILS_OBJ_H
#define MODUTILS_OBJ_H 1
-#ident "$Id: insmod.c,v 1.28 2000/10/23 18:03:46 kraai Exp $"
+#ident "$Id: insmod.c,v 1.29 2000/12/01 02:55:13 kraai Exp $"
/* The relocatable object is manipulated using elfin types. */
FILE *fp;
struct obj_file *f;
char m_name[BUFSIZ + 1] = "\0";
- int exit_status = FALSE;
+ int exit_status = EXIT_FAILURE;
int m_has_modinfo;
#ifdef BB_FEATURE_INSMOD_VERSION_CHECKING
int k_version;
|| ((fp = fopen(m_filename, "r")) == NULL))
{
errorMsg("No module named '%s' found in '%s'\n", m_fullName, _PATH_MODULES);
- exit(FALSE);
+ return EXIT_FAILURE;
}
} else
fatalError("No module named '%s' found in '%s'\n", m_fullName, _PATH_MODULES);
if ((f = obj_load(fp)) == NULL) {
perror("Could not load the module\n");
- exit(FALSE);
+ return EXIT_FAILURE;
}
if (get_modinfo_value(f, "kernel_version") == NULL)
goto out;
}
- exit_status = TRUE;
+ exit_status = EXIT_SUCCESS;
out:
fclose(fp);
}
}
fprintf(stderr, "\n\n");
- exit(TRUE);
+ return EXIT_SUCCESS;
}
break;
case '-':
* upon exit, so we can save a byte or two */
argv++;
}
- exit (all_found);
+ if (all_found == FALSE)
+ return EXIT_FAILURE;
}
#endif
- exit(TRUE);
+ return EXIT_SUCCESS;
end:
newdir = cmd->progs[0].argv[1];
if (chdir(newdir)) {
printf("cd: %s: %s\n", newdir, strerror(errno));
- return FALSE;
+ return EXIT_FAILURE;
}
getcwd(cwd, sizeof(char)*MAX_LINE);
- return TRUE;
+ return EXIT_SUCCESS;
}
/* built-in 'env' handler */
fatalError("Exec to %s failed: %s\n", cmd->progs[0].argv[0],
strerror(errno));
}
- return TRUE;
+ return EXIT_SUCCESS;
}
/* built-in 'exit' handler */
static int builtin_exit(struct job *cmd, struct jobSet *junk)
{
if (!cmd->progs[0].argv[1] == 1)
- exit TRUE;
+ exit(EXIT_SUCCESS);
exit (atoi(cmd->progs[0].argv[1]));
}
if (!cmd->progs[0].argv[1] || cmd->progs[0].argv[2]) {
errorMsg("%s: exactly one argument is expected\n",
cmd->progs[0].argv[0]);
- return FALSE;
+ return EXIT_FAILURE;
}
if (sscanf(cmd->progs[0].argv[1], "%%%d", &jobNum) != 1) {
errorMsg("%s: bad argument '%s'\n",
cmd->progs[0].argv[0], cmd->progs[0].argv[1]);
- return FALSE;
+ return EXIT_FAILURE;
for (job = jobList->head; job; job = job->next) {
if (job->jobId == jobNum) {
break;
if (!job) {
errorMsg("%s: unknown job %d\n",
cmd->progs[0].argv[0], jobNum);
- return FALSE;
+ return EXIT_FAILURE;
}
if (*cmd->progs[0].argv[0] == 'f') {
job->stoppedProgs = 0;
- return TRUE;
+ return EXIT_SUCCESS;
}
/* built-in 'help' handler */
fprintf(stdout, "%s\t%s\n", x->cmd, x->descr);
}
fprintf(stdout, "\n\n");
- return TRUE;
+ return EXIT_SUCCESS;
}
/* built-in 'jobs' handler */
printf(JOB_STATUS_FORMAT, job->jobId, statusString, job->text);
}
- return TRUE;
+ return EXIT_SUCCESS;
}
{
getcwd(cwd, sizeof(char)*MAX_LINE);
fprintf(stdout, "%s\n", cwd);
- return TRUE;
+ return EXIT_SUCCESS;
}
/* built-in 'export VAR=value' handler */
if (! (cmd->jobContext & (IF_TRUE_CONTEXT|IF_FALSE_CONTEXT))) {
errorMsg("unexpected token `then'\n");
- return FALSE;
+ return EXIT_FAILURE;
}
/* If the if result was FALSE, skip the 'then' stuff */
if (cmd->jobContext & IF_FALSE_CONTEXT) {
- return TRUE;
+ return EXIT_SUCCESS;
}
cmd->jobContext |= THEN_EXP_CONTEXT;
if (! (cmd->jobContext & (IF_TRUE_CONTEXT|IF_FALSE_CONTEXT))) {
errorMsg("unexpected token `else'\n");
- return FALSE;
+ return EXIT_FAILURE;
}
/* If the if result was TRUE, skip the 'else' stuff */
if (cmd->jobContext & IF_TRUE_CONTEXT) {
- return TRUE;
+ return EXIT_SUCCESS;
}
cmd->jobContext |= ELSE_EXP_CONTEXT;
{
if (! (cmd->jobContext & (IF_TRUE_CONTEXT|IF_FALSE_CONTEXT))) {
errorMsg("unexpected token `fi'\n");
- return FALSE;
+ return EXIT_FAILURE;
}
/* Clear out the if and then context bits */
cmd->jobContext &= ~(IF_TRUE_CONTEXT|IF_FALSE_CONTEXT|THEN_EXP_CONTEXT|ELSE_EXP_CONTEXT);
debug_printf(stderr, "Hit an fi -- jobContext=%d\n", cmd->jobContext);
- return TRUE;
+ return EXIT_SUCCESS;
}
#endif
int status;
if (!cmd->progs[0].argv[1] == 1)
- return FALSE;
+ return EXIT_FAILURE;
input = fopen(cmd->progs[0].argv[1], "r");
if (!input) {
fprintf(stdout, "Couldn't open file '%s'\n",
cmd->progs[0].argv[1]);
- return FALSE;
+ return EXIT_FAILURE;
}
/* Now run the file */
{
if (!cmd->progs[0].argv[1] == 1) {
fprintf(stdout, "unset: parameter required.\n");
- return FALSE;
+ return EXIT_FAILURE;
}
unsetenv(cmd->progs[0].argv[1]);
- return TRUE;
+ return EXIT_SUCCESS;
}
/* free up all memory from a job */
if (argc != 2 || **(argv + 1) == '-')
usage(length_usage);
printf("%lu\n", (long)strlen(argv[1]));
- return (TRUE);
+ return EXIT_SUCCESS;
}
fd = open("/dev/tty", O_RDWR);
if (fd < 0) {
errorMsg("Error opening /dev/tty1: %s\n", strerror(errno));
- return( FALSE);
+ return EXIT_FAILURE;
}
if (screen_map_load(fd, stdin)) {
errorMsg("Error loading acm: %s\n", strerror(errno));
- return( FALSE);
+ return EXIT_FAILURE;
}
write(fd, "\033(K", 3);
- return( TRUE);
+ return EXIT_SUCCESS;
}
int screen_map_load(int fd, FILE * fp)
print_usage_message:
usage(ls_usage);
- return(FALSE);
}
if (file_type_specified && do_check) {
errorMsg("the -b and -t options are meaningless when verifying checksums\n");
- exit FALSE;
+ return EXIT_FAILURE;
}
if (n_strings > 0 && do_check) {
errorMsg("the -g and -c options are mutually exclusive\n");
- exit FALSE;
+ return EXIT_FAILURE;
}
if (status_only && !do_check) {
errorMsg("the -s option is meaningful only when verifying checksums\n");
- exit FALSE;
+ return EXIT_FAILURE;
}
if (warn && !do_check) {
errorMsg("the -w option is meaningful only when verifying checksums\n");
- exit FALSE;
+ return EXIT_FAILURE;
}
if (n_strings > 0) {
if (optind < argc) {
errorMsg("no files may be specified when using -g\n");
- exit FALSE;
+ return EXIT_FAILURE;
}
for (i = 0; i < n_strings; ++i) {
size_t cnt;
if (fclose (stdout) == EOF) {
errorMsg("write error\n");
- exit FALSE;
+ return EXIT_FAILURE;
}
if (have_read_stdin && fclose (stdin) == EOF) {
errorMsg("standard input\n");
- exit FALSE;
+ return EXIT_FAILURE;
}
- exit (err == 0 ? TRUE : FALSE);
+ if (err == 0)
+ return EXIT_SUCCESS;
+ else
+ return EXIT_FAILURE;
}
static void push(double a)
{
- if (pointer >= (sizeof(stack) / sizeof(*stack))) {
- errorMsg("stack overflow\n");
- exit(-1);
- } else
- stack[pointer++] = a;
+ if (pointer >= (sizeof(stack) / sizeof(*stack)))
+ fatalError("stack overflow\n");
+ stack[pointer++] = a;
}
static double pop()
{
- if (pointer == 0) {
- errorMsg("stack underflow\n");
- exit(-1);
- }
+ if (pointer == 0)
+ fatalError("stack underflow\n");
return stack[--pointer];
}
}
o++;
}
- errorMsg("%s: syntax error.\n", argument);
- exit(-1);
+ fatalError("%s: syntax error.\n", argument);
}
/* return pointer to next token in buffer and set *buffer to one char
}
}
stack_machine(0);
- return( TRUE);
+ return EXIT_SUCCESS;
}
ut.ut_addr);
}
#endif
- return(TRUE);
+ return EXIT_SUCCESS;
}
if (argc != 2 && (argc != 3 || strcmp(argv[1], "-q")))
usage(mktemp_usage);
if(mkstemp(argv[argc-1]) < 0)
- exit(FALSE);
+ return EXIT_FAILURE;
(void) puts(argv[argc-1]);
- return(TRUE);
+ return EXIT_SUCCESS;
}
if (code->name == 0) {
errorMsg("unrecognized opcode %s.\n", argv[1]);
- exit (FALSE);
+ return EXIT_FAILURE;
}
op.mt_op = code->value;
if ((fd = open(file, O_RDONLY, 0)) < 0) {
perror(file);
- exit (FALSE);
+ return EXIT_FAILURE;
}
if (ioctl(fd, MTIOCTOP, &op) != 0) {
perror(file);
- exit (FALSE);
+ return EXIT_FAILURE;
}
- return (TRUE);
+ return EXIT_SUCCESS;
}
pid = fork();
if (pid < 0)
- exit(FALSE);
+ return EXIT_FAILURE;
else if (pid == 0) {
/* Become a proper daemon */
setsid();
syslog(LOG_INFO,
"This kernel does not need update(8). Exiting.");
closelog();
- exit(TRUE);
+ return EXIT_SUCCESS;
}
}
}
}
- return( TRUE);
+ return EXIT_SUCCESS;
}
/*
mode = 0;
if (parse_mode(*(++argv), &mode) == FALSE) {
errorMsg("Unknown mode: %s\n", *argv);
- exit FALSE;
+ return EXIT_FAILURE;
}
/* Set the umask for this process so it doesn't
* screw up whatever the user just entered. */
if (strlen(*argv) > BUFSIZ - 1) {
errorMsg(name_too_long);
- exit FALSE;
+ return EXIT_FAILURE;
}
strcpy(buf, *argv);
status = stat(buf, &statBuf);
if (parentFlag == FALSE && status != -1 && errno != ENOENT) {
errorMsg("%s: File exists\n", buf);
- exit FALSE;
+ return EXIT_FAILURE;
}
if (parentFlag == TRUE) {
strcat(buf, "/");
} else {
if (mkdir(buf, mode) != 0 && parentFlag == FALSE) {
perror(buf);
- exit FALSE;
+ return EXIT_FAILURE;
}
}
argc--;
argv++;
}
- return( TRUE);
+ return EXIT_SUCCESS;
}
usage(mkfifo_usage);
if (mkfifo(*argv, mode) < 0) {
perror("mkfifo");
- exit(255);
+ return EXIT_FAILURE;
}
- return(TRUE);
+ return EXIT_SUCCESS;
}
if (mknod(argv[0], mode, dev) != 0)
fatalError("%s: %s\n", argv[0], strerror(errno));
- return (TRUE);
+ return EXIT_SUCCESS;
}
void die(const char *str)
{
errorMsg("%s\n", str);
- exit(FALSE);
+ exit(EXIT_FAILURE);
}
void page_ok(int page)
} else if (PAGES > sz && !force) {
errorMsg("error: size %ld is larger than device size %d\n",
PAGES * (pagesize / 1024), sz * (pagesize / 1024));
- exit(FALSE);
+ return EXIT_FAILURE;
}
if (version == -1) {
DEV = open(device_name, O_RDWR);
if (DEV < 0 || fstat(DEV, &statbuf) < 0) {
perror(device_name);
- exit(FALSE);
+ return EXIT_FAILURE;
}
if (!S_ISBLK(statbuf.st_mode))
check = 0;
"This probably means creating v0 swap would destroy your partition table\n"
"No swap created. If you really want to create swap v0 on that device, use\n"
"the -f option to force it.\n", device_name);
- exit(FALSE);
+ return EXIT_FAILURE;
}
}
}
*/
if (fsync(DEV))
die("fsync failed");
- return(TRUE);
+ return EXIT_SUCCESS;
}
if (argc != 2 && (argc != 3 || strcmp(argv[1], "-q")))
usage(mktemp_usage);
if(mkstemp(argv[argc-1]) < 0)
- exit(FALSE);
+ return EXIT_FAILURE;
(void) puts(argv[argc-1]);
- return(TRUE);
+ return EXIT_SUCCESS;
}
#ifndef MODUTILS_MODULE_H
#define MODUTILS_MODULE_H 1
-#ident "$Id: insmod.c,v 1.28 2000/10/23 18:03:46 kraai Exp $"
+#ident "$Id: insmod.c,v 1.29 2000/12/01 02:55:13 kraai Exp $"
/* This file contains the structures used by the 2.0 and 2.1 kernels.
We do not use the kernel headers directly because we do not wish
#ifndef MODUTILS_OBJ_H
#define MODUTILS_OBJ_H 1
-#ident "$Id: insmod.c,v 1.28 2000/10/23 18:03:46 kraai Exp $"
+#ident "$Id: insmod.c,v 1.29 2000/12/01 02:55:13 kraai Exp $"
/* The relocatable object is manipulated using elfin types. */
FILE *fp;
struct obj_file *f;
char m_name[BUFSIZ + 1] = "\0";
- int exit_status = FALSE;
+ int exit_status = EXIT_FAILURE;
int m_has_modinfo;
#ifdef BB_FEATURE_INSMOD_VERSION_CHECKING
int k_version;
|| ((fp = fopen(m_filename, "r")) == NULL))
{
errorMsg("No module named '%s' found in '%s'\n", m_fullName, _PATH_MODULES);
- exit(FALSE);
+ return EXIT_FAILURE;
}
} else
fatalError("No module named '%s' found in '%s'\n", m_fullName, _PATH_MODULES);
if ((f = obj_load(fp)) == NULL) {
perror("Could not load the module\n");
- exit(FALSE);
+ return EXIT_FAILURE;
}
if (get_modinfo_value(f, "kernel_version") == NULL)
goto out;
}
- exit_status = TRUE;
+ exit_status = EXIT_SUCCESS;
out:
fclose(fp);
extern int rmmod_main(int argc, char **argv)
{
- int ret = TRUE;
+ int ret = EXIT_SUCCESS;
if (argc <= 1) {
usage(rmmod_usage);
}
/* Unload _all_ unused modules via NULL delete_module() call */
if (delete_module(NULL)) {
perror("rmmod");
- exit(FALSE);
+ return EXIT_FAILURE;
}
- exit(TRUE);
+ return EXIT_SUCCESS;
default:
usage(rmmod_usage);
}
while (argc-- > 0) {
if (delete_module(*argv) < 0) {
perror(*argv);
- ret=FALSE;
+ ret = EXIT_FAILURE;
}
argv++;
}
int fakeIt = FALSE;
int useMtab = TRUE;
int i;
- int rc = FALSE;
+ int rc = EXIT_FAILURE;
int fstabmount = FALSE;
#if defined BB_FEATURE_USE_DEVPS_PATCH
free( mntentlist);
close(fd);
#endif
- exit(TRUE);
+ return EXIT_SUCCESS;
}
#else
if (argc == 1) {
} else {
perror(mtab_file);
}
- exit(TRUE);
+ return EXIT_SUCCESS;
}
#endif
&extra_opts, &string_flags, 1);
if ( rc != 0) {
fatalError("nfsmount failed: %s\n", strerror(errno));
- rc = FALSE;
+ rc = EXIT_FAILURE;
}
}
#endif
if (all == FALSE)
break;
- rc = TRUE; // Always return 0 for 'all'
+ rc = EXIT_SUCCESS; // Always return 0 for 'all'
}
if (fstabmount == TRUE)
endmntent(f);
goto singlemount;
- exit(FALSE);
-
goodbye:
usage(mount_usage);
}
if (code->name == 0) {
errorMsg("unrecognized opcode %s.\n", argv[1]);
- exit (FALSE);
+ return EXIT_FAILURE;
}
op.mt_op = code->value;
if ((fd = open(file, O_RDONLY, 0)) < 0) {
perror(file);
- exit (FALSE);
+ return EXIT_FAILURE;
}
if (ioctl(fd, MTIOCTOP, &op) != 0) {
perror(file);
- exit (FALSE);
+ return EXIT_FAILURE;
}
- return (TRUE);
+ return EXIT_SUCCESS;
}
host = gethostbyname(argv[1]);
}
hostent_fprint(host, stdout);
- return( TRUE);
+ return EXIT_SUCCESS;
}
-/* $Id: nslookup.c,v 1.12 2000/09/25 21:45:58 andersen Exp $ */
+/* $Id: nslookup.c,v 1.13 2000/12/01 02:55:13 kraai Exp $ */
/* vi: set sw=4 ts=4: */
/*
- * $Id: ping.c,v 1.26 2000/11/14 23:29:24 andersen Exp $
+ * $Id: ping.c,v 1.27 2000/12/01 02:55:13 kraai Exp $
* Mini ping implementation for busybox
*
* Copyright (C) 1999 by Randolph Chung <tausq@debian.org>
if (argc < 1)
usage(ping_usage);
ping(*argv);
- exit(TRUE);
+ return EXIT_SUCCESS;
}
#else /* ! BB_FEATURE_SIMPLE_PING */
myid = getpid() & 0xFFFF;
ping(*argv);
- return(TRUE);
+ return EXIT_SUCCESS;
}
#endif /* ! BB_FEATURE_SIMPLE_PING */
host = gethostbyname(argv[1]);
}
hostent_fprint(host, stdout);
- return( TRUE);
+ return EXIT_SUCCESS;
}
-/* $Id: nslookup.c,v 1.12 2000/09/25 21:45:58 andersen Exp $ */
+/* $Id: nslookup.c,v 1.13 2000/12/01 02:55:13 kraai Exp $ */
/* vi: set sw=4 ts=4: */
/*
- * $Id: ping.c,v 1.26 2000/11/14 23:29:24 andersen Exp $
+ * $Id: ping.c,v 1.27 2000/12/01 02:55:13 kraai Exp $
* Mini ping implementation for busybox
*
* Copyright (C) 1999 by Randolph Chung <tausq@debian.org>
if (argc < 1)
usage(ping_usage);
ping(*argv);
- exit(TRUE);
+ return EXIT_SUCCESS;
}
#else /* ! BB_FEATURE_SIMPLE_PING */
myid = getpid() & 0xFFFF;
ping(*argv);
- return(TRUE);
+ return EXIT_SUCCESS;
}
#endif /* ! BB_FEATURE_SIMPLE_PING */
printf("%6s%13ld%13ld%13ld\n", "Total:", info.totalram+info.totalswap,
(info.totalram-info.freeram)+(info.totalswap-info.freeswap),
info.freeram+info.freeswap);
- return(TRUE);
+ return EXIT_SUCCESS;
}
}
}
fprintf(stderr, "\n\n");
- exit(TRUE);
+ return EXIT_SUCCESS;
}
break;
case '-':
* upon exit, so we can save a byte or two */
argv++;
}
- exit (all_found);
+ if (all_found == FALSE)
+ return EXIT_FAILURE;
}
#endif
- exit(TRUE);
+ return EXIT_SUCCESS;
end:
fprintf(stdout, "\n");
}
closedir(dir);
- return(TRUE);
+ return EXIT_SUCCESS;
}
LOAD_INT(info.loads[1]), LOAD_FRAC(info.loads[1]),
LOAD_INT(info.loads[2]), LOAD_FRAC(info.loads[2]));
- return(TRUE);
+ return EXIT_SUCCESS;
}
fprintf(stdout, "\n");
}
closedir(dir);
- return(TRUE);
+ return EXIT_SUCCESS;
}
fatalError("%s\n", strerror(errno));
printf("%s\n", buf);
- return(TRUE);
+ return EXIT_SUCCESS;
}
default:
case 'H':
usage(rdate_usage);
- return(FALSE);
break;
case 's':
setdate++;
if (optind == argc) {
usage(rdate_usage);
- return(FALSE);
}
if ((time= askremotedate(argv[optind])) == (time_t)-1) {
- return(FALSE);
+ return EXIT_FAILURE;
}
if (setdate) {
if (stime(&time) < 0)
fprintf(stdout, "%s", ctime(&time));
}
- return(TRUE);
+ return EXIT_SUCCESS;
}
extern int reset_main(int argc, char **argv)
{
printf("\033c");
- return(TRUE);
+ return EXIT_SUCCESS;
}
} else {
if (recursiveAction(srcName, recursiveFlag, FALSE,
TRUE, fileAction, dirAction, NULL) == FALSE) {
- exit(FALSE);
+ return EXIT_FAILURE;
}
}
}
- return(TRUE);
+ return EXIT_SUCCESS;
}
extern int rmmod_main(int argc, char **argv)
{
- int ret = TRUE;
+ int ret = EXIT_SUCCESS;
if (argc <= 1) {
usage(rmmod_usage);
}
/* Unload _all_ unused modules via NULL delete_module() call */
if (delete_module(NULL)) {
perror("rmmod");
- exit(FALSE);
+ return EXIT_FAILURE;
}
- exit(TRUE);
+ return EXIT_SUCCESS;
default:
usage(rmmod_usage);
}
while (argc-- > 0) {
if (delete_module(*argv) < 0) {
perror(*argv);
- ret=FALSE;
+ ret = EXIT_FAILURE;
}
argv++;
}
argc -= 2;
argv += 2;
}
- return( TRUE);
+ return EXIT_SUCCESS;
}
newdir = cmd->progs[0].argv[1];
if (chdir(newdir)) {
printf("cd: %s: %s\n", newdir, strerror(errno));
- return FALSE;
+ return EXIT_FAILURE;
}
getcwd(cwd, sizeof(char)*MAX_LINE);
- return TRUE;
+ return EXIT_SUCCESS;
}
/* built-in 'env' handler */
fatalError("Exec to %s failed: %s\n", cmd->progs[0].argv[0],
strerror(errno));
}
- return TRUE;
+ return EXIT_SUCCESS;
}
/* built-in 'exit' handler */
static int builtin_exit(struct job *cmd, struct jobSet *junk)
{
if (!cmd->progs[0].argv[1] == 1)
- exit TRUE;
+ exit(EXIT_SUCCESS);
exit (atoi(cmd->progs[0].argv[1]));
}
if (!cmd->progs[0].argv[1] || cmd->progs[0].argv[2]) {
errorMsg("%s: exactly one argument is expected\n",
cmd->progs[0].argv[0]);
- return FALSE;
+ return EXIT_FAILURE;
}
if (sscanf(cmd->progs[0].argv[1], "%%%d", &jobNum) != 1) {
errorMsg("%s: bad argument '%s'\n",
cmd->progs[0].argv[0], cmd->progs[0].argv[1]);
- return FALSE;
+ return EXIT_FAILURE;
for (job = jobList->head; job; job = job->next) {
if (job->jobId == jobNum) {
break;
if (!job) {
errorMsg("%s: unknown job %d\n",
cmd->progs[0].argv[0], jobNum);
- return FALSE;
+ return EXIT_FAILURE;
}
if (*cmd->progs[0].argv[0] == 'f') {
job->stoppedProgs = 0;
- return TRUE;
+ return EXIT_SUCCESS;
}
/* built-in 'help' handler */
fprintf(stdout, "%s\t%s\n", x->cmd, x->descr);
}
fprintf(stdout, "\n\n");
- return TRUE;
+ return EXIT_SUCCESS;
}
/* built-in 'jobs' handler */
printf(JOB_STATUS_FORMAT, job->jobId, statusString, job->text);
}
- return TRUE;
+ return EXIT_SUCCESS;
}
{
getcwd(cwd, sizeof(char)*MAX_LINE);
fprintf(stdout, "%s\n", cwd);
- return TRUE;
+ return EXIT_SUCCESS;
}
/* built-in 'export VAR=value' handler */
if (! (cmd->jobContext & (IF_TRUE_CONTEXT|IF_FALSE_CONTEXT))) {
errorMsg("unexpected token `then'\n");
- return FALSE;
+ return EXIT_FAILURE;
}
/* If the if result was FALSE, skip the 'then' stuff */
if (cmd->jobContext & IF_FALSE_CONTEXT) {
- return TRUE;
+ return EXIT_SUCCESS;
}
cmd->jobContext |= THEN_EXP_CONTEXT;
if (! (cmd->jobContext & (IF_TRUE_CONTEXT|IF_FALSE_CONTEXT))) {
errorMsg("unexpected token `else'\n");
- return FALSE;
+ return EXIT_FAILURE;
}
/* If the if result was TRUE, skip the 'else' stuff */
if (cmd->jobContext & IF_TRUE_CONTEXT) {
- return TRUE;
+ return EXIT_SUCCESS;
}
cmd->jobContext |= ELSE_EXP_CONTEXT;
{
if (! (cmd->jobContext & (IF_TRUE_CONTEXT|IF_FALSE_CONTEXT))) {
errorMsg("unexpected token `fi'\n");
- return FALSE;
+ return EXIT_FAILURE;
}
/* Clear out the if and then context bits */
cmd->jobContext &= ~(IF_TRUE_CONTEXT|IF_FALSE_CONTEXT|THEN_EXP_CONTEXT|ELSE_EXP_CONTEXT);
debug_printf(stderr, "Hit an fi -- jobContext=%d\n", cmd->jobContext);
- return TRUE;
+ return EXIT_SUCCESS;
}
#endif
int status;
if (!cmd->progs[0].argv[1] == 1)
- return FALSE;
+ return EXIT_FAILURE;
input = fopen(cmd->progs[0].argv[1], "r");
if (!input) {
fprintf(stdout, "Couldn't open file '%s'\n",
cmd->progs[0].argv[1]);
- return FALSE;
+ return EXIT_FAILURE;
}
/* Now run the file */
{
if (!cmd->progs[0].argv[1] == 1) {
fprintf(stdout, "unset: parameter required.\n");
- return FALSE;
+ return EXIT_FAILURE;
}
unsetenv(cmd->progs[0].argv[1]);
- return TRUE;
+ return EXIT_SUCCESS;
}
/* free up all memory from a job */
cmdedit_reset_term();
fprintf(stdout, "\n");
if (sig!=SIGINT)
- exit(TRUE);
+ exit(EXIT_SUCCESS);
}
/* Go to HOME position */
newdir = cmd->progs[0].argv[1];
if (chdir(newdir)) {
printf("cd: %s: %s\n", newdir, strerror(errno));
- return FALSE;
+ return EXIT_FAILURE;
}
getcwd(cwd, sizeof(char)*MAX_LINE);
- return TRUE;
+ return EXIT_SUCCESS;
}
/* built-in 'env' handler */
fatalError("Exec to %s failed: %s\n", cmd->progs[0].argv[0],
strerror(errno));
}
- return TRUE;
+ return EXIT_SUCCESS;
}
/* built-in 'exit' handler */
static int builtin_exit(struct job *cmd, struct jobSet *junk)
{
if (!cmd->progs[0].argv[1] == 1)
- exit TRUE;
+ exit(EXIT_SUCCESS);
exit (atoi(cmd->progs[0].argv[1]));
}
if (!cmd->progs[0].argv[1] || cmd->progs[0].argv[2]) {
errorMsg("%s: exactly one argument is expected\n",
cmd->progs[0].argv[0]);
- return FALSE;
+ return EXIT_FAILURE;
}
if (sscanf(cmd->progs[0].argv[1], "%%%d", &jobNum) != 1) {
errorMsg("%s: bad argument '%s'\n",
cmd->progs[0].argv[0], cmd->progs[0].argv[1]);
- return FALSE;
+ return EXIT_FAILURE;
for (job = jobList->head; job; job = job->next) {
if (job->jobId == jobNum) {
break;
if (!job) {
errorMsg("%s: unknown job %d\n",
cmd->progs[0].argv[0], jobNum);
- return FALSE;
+ return EXIT_FAILURE;
}
if (*cmd->progs[0].argv[0] == 'f') {
job->stoppedProgs = 0;
- return TRUE;
+ return EXIT_SUCCESS;
}
/* built-in 'help' handler */
fprintf(stdout, "%s\t%s\n", x->cmd, x->descr);
}
fprintf(stdout, "\n\n");
- return TRUE;
+ return EXIT_SUCCESS;
}
/* built-in 'jobs' handler */
printf(JOB_STATUS_FORMAT, job->jobId, statusString, job->text);
}
- return TRUE;
+ return EXIT_SUCCESS;
}
{
getcwd(cwd, sizeof(char)*MAX_LINE);
fprintf(stdout, "%s\n", cwd);
- return TRUE;
+ return EXIT_SUCCESS;
}
/* built-in 'export VAR=value' handler */
if (! (cmd->jobContext & (IF_TRUE_CONTEXT|IF_FALSE_CONTEXT))) {
errorMsg("unexpected token `then'\n");
- return FALSE;
+ return EXIT_FAILURE;
}
/* If the if result was FALSE, skip the 'then' stuff */
if (cmd->jobContext & IF_FALSE_CONTEXT) {
- return TRUE;
+ return EXIT_SUCCESS;
}
cmd->jobContext |= THEN_EXP_CONTEXT;
if (! (cmd->jobContext & (IF_TRUE_CONTEXT|IF_FALSE_CONTEXT))) {
errorMsg("unexpected token `else'\n");
- return FALSE;
+ return EXIT_FAILURE;
}
/* If the if result was TRUE, skip the 'else' stuff */
if (cmd->jobContext & IF_TRUE_CONTEXT) {
- return TRUE;
+ return EXIT_SUCCESS;
}
cmd->jobContext |= ELSE_EXP_CONTEXT;
{
if (! (cmd->jobContext & (IF_TRUE_CONTEXT|IF_FALSE_CONTEXT))) {
errorMsg("unexpected token `fi'\n");
- return FALSE;
+ return EXIT_FAILURE;
}
/* Clear out the if and then context bits */
cmd->jobContext &= ~(IF_TRUE_CONTEXT|IF_FALSE_CONTEXT|THEN_EXP_CONTEXT|ELSE_EXP_CONTEXT);
debug_printf(stderr, "Hit an fi -- jobContext=%d\n", cmd->jobContext);
- return TRUE;
+ return EXIT_SUCCESS;
}
#endif
int status;
if (!cmd->progs[0].argv[1] == 1)
- return FALSE;
+ return EXIT_FAILURE;
input = fopen(cmd->progs[0].argv[1], "r");
if (!input) {
fprintf(stdout, "Couldn't open file '%s'\n",
cmd->progs[0].argv[1]);
- return FALSE;
+ return EXIT_FAILURE;
}
/* Now run the file */
{
if (!cmd->progs[0].argv[1] == 1) {
fprintf(stdout, "unset: parameter required.\n");
- return FALSE;
+ return EXIT_FAILURE;
}
unsetenv(cmd->progs[0].argv[1]);
- return TRUE;
+ return EXIT_SUCCESS;
}
/* free up all memory from a job */
if (sleep(atoi(*(++argv))) != 0) {
perror("sleep");
- exit(FALSE);
+ return EXIT_FAILURE;
}
- return(TRUE);
+ return EXIT_SUCCESS;
}
if (status != 0) {
perror(applet_name);
- exit(FALSE);
+ exit(EXIT_FAILURE);
}
}
}
}
endmntent(f);
- exit(TRUE);
+ exit(EXIT_SUCCESS);
}
}
}
swap_enable_disable(*argv);
- exit(TRUE);
+ return EXIT_SUCCESS;
usage_and_exit:
usage((whichApp == SWAPON_APP) ? swapon_usage : swapoff_usage);
- exit(FALSE);
}
doSyslogd();
}
- return(TRUE);
+ return EXIT_SUCCESS;
}
/*
doSyslogd();
}
- return(TRUE);
+ return EXIT_SUCCESS;
}
/*
int tostdoutFlag = FALSE;
int firstOpt = TRUE;
int stopIt;
+ int status;
if (argc <= 1)
#ifndef BB_FEATURE_TAR_CREATE
fatalError( "This version of tar was not compiled with tar creation support.\n");
#else
- exit(writeTarFile(tarName, verboseFlag, argv, excludeList));
+ status = writeTarFile(tarName, verboseFlag, argv, excludeList);
#endif
}
if (listFlag == TRUE || extractFlag == TRUE) {
if (*argv)
extractList = argv;
- exit(readTarFile(tarName, extractFlag, listFlag, tostdoutFlag,
- verboseFlag, extractList, excludeList));
+ status = readTarFile(tarName, extractFlag, listFlag, tostdoutFlag,
+ verboseFlag, extractList, excludeList);
}
+ if (status == TRUE)
+ return EXIT_SUCCESS;
+ else
+ return EXIT_FAILURE;
+
flagError:
fatalError( "Exactly one of 'c', 'x' or 't' must be specified\n");
}
break;
default:
usage(touch_usage);
- exit(FALSE);
}
}
}
S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH);
if (fd < 0) {
if (create == FALSE && errno == ENOENT)
- exit(TRUE);
+ return EXIT_SUCCESS;
else {
fatalError("%s", strerror(errno));
}
argv++;
}
- return(TRUE);
+ return EXIT_SUCCESS;
}
extern int true_main(int argc, char **argv)
{
- return(TRUE);
+ return EXIT_SUCCESS;
}
extern int false_main(int argc, char **argv)
{
- return(FALSE);
+ return EXIT_FAILURE;
}
else
puts("not a tty");
}
- return(isatty(0) ? TRUE : FALSE);
+ return(isatty(0) ? EXIT_SUCCESS : EXIT_FAILURE);
}
mtab_read();
if (umountAll == TRUE) {
- exit(umount_all(useMtab));
+ if (umount_all(useMtab) == TRUE)
+ return EXIT_SUCCESS;
+ else
+ return EXIT_FAILURE;
}
if (do_umount(*argv, useMtab) == 0)
- exit(TRUE);
+ return EXIT_SUCCESS;
perror("umount");
- return(FALSE);
+ return EXIT_FAILURE;
}
print_element(PRINT_MACHINE, name.machine);
print_element(PRINT_PROCESSOR, processor);
- return(TRUE);
+ return EXIT_SUCCESS;
}
/* If the name element set in MASK is selected for printing in `toprint',
pid = fork();
if (pid < 0)
- exit(FALSE);
+ return EXIT_FAILURE;
else if (pid == 0) {
/* Become a proper daemon */
setsid();
syslog(LOG_INFO,
"This kernel does not need update(8). Exiting.");
closelog();
- exit(TRUE);
+ return EXIT_SUCCESS;
}
}
}
}
- return( TRUE);
+ return EXIT_SUCCESS;
}
/*
LOAD_INT(info.loads[1]), LOAD_FRAC(info.loads[1]),
LOAD_INT(info.loads[2]), LOAD_FRAC(info.loads[2]));
- return(TRUE);
+ return EXIT_SUCCESS;
}
}
usleep(atoi(*(++argv))); /* return void */
- return(TRUE);
+ return EXIT_SUCCESS;
}
if (n < 0) {
goto klogctl_error;
}
- exit(TRUE);
+ return EXIT_SUCCESS;
}
if (bufsize < 4096)
}
if (lastc != '\n')
putchar('\n');
- exit(TRUE);
+ return EXIT_SUCCESS;
end:
usage(dmesg_usage);
- exit(FALSE);
+ return EXIT_FAILURE;
klogctl_error:
perror("klogctl");
- return(FALSE);
+ return EXIT_FAILURE;
}
if (g_options & OPT_READMODE) {
if (!readmode(&var, modefile, mode)) {
errorMsg("Unknown video mode `%s'\n", mode);
- exit(1);
+ return EXIT_FAILURE;
}
}
/* Don't close the file, as exiting will take care of that */
/* close(fh); */
- return (TRUE);
+ return EXIT_SUCCESS;
}
fd = open(*argv, 0);
if (fd < 0) {
perror(*argv);
- exit(FALSE);
+ return EXIT_FAILURE;
}
value = ioctl(fd, FDFLUSH, 0);
if (value) {
perror(*argv);
- exit(FALSE);
+ return EXIT_FAILURE;
}
- return(TRUE);
+ return EXIT_SUCCESS;
}
/* Don't bother closing. Exit does
* that, so we can save a few bytes */
/* close(f); */
- return(TRUE);
+ return EXIT_SUCCESS;
}
/*
void die(const char *str)
{
errorMsg("%s\n", str);
- exit(FALSE);
+ exit(EXIT_FAILURE);
}
void page_ok(int page)
} else if (PAGES > sz && !force) {
errorMsg("error: size %ld is larger than device size %d\n",
PAGES * (pagesize / 1024), sz * (pagesize / 1024));
- exit(FALSE);
+ return EXIT_FAILURE;
}
if (version == -1) {
DEV = open(device_name, O_RDWR);
if (DEV < 0 || fstat(DEV, &statbuf) < 0) {
perror(device_name);
- exit(FALSE);
+ return EXIT_FAILURE;
}
if (!S_ISBLK(statbuf.st_mode))
check = 0;
"This probably means creating v0 swap would destroy your partition table\n"
"No swap created. If you really want to create swap v0 on that device, use\n"
"the -f option to force it.\n", device_name);
- exit(FALSE);
+ return EXIT_FAILURE;
}
}
}
*/
if (fsync(DEV))
die("fsync failed");
- return(TRUE);
+ return EXIT_SUCCESS;
}
int fakeIt = FALSE;
int useMtab = TRUE;
int i;
- int rc = FALSE;
+ int rc = EXIT_FAILURE;
int fstabmount = FALSE;
#if defined BB_FEATURE_USE_DEVPS_PATCH
free( mntentlist);
close(fd);
#endif
- exit(TRUE);
+ return EXIT_SUCCESS;
}
#else
if (argc == 1) {
} else {
perror(mtab_file);
}
- exit(TRUE);
+ return EXIT_SUCCESS;
}
#endif
&extra_opts, &string_flags, 1);
if ( rc != 0) {
fatalError("nfsmount failed: %s\n", strerror(errno));
- rc = FALSE;
+ rc = EXIT_FAILURE;
}
}
#endif
if (all == FALSE)
break;
- rc = TRUE; // Always return 0 for 'all'
+ rc = EXIT_SUCCESS; // Always return 0 for 'all'
}
if (fstabmount == TRUE)
endmntent(f);
goto singlemount;
- exit(FALSE);
-
goodbye:
usage(mount_usage);
}
default:
case 'H':
usage(rdate_usage);
- return(FALSE);
break;
case 's':
setdate++;
if (optind == argc) {
usage(rdate_usage);
- return(FALSE);
}
if ((time= askremotedate(argv[optind])) == (time_t)-1) {
- return(FALSE);
+ return EXIT_FAILURE;
}
if (setdate) {
if (stime(&time) < 0)
fprintf(stdout, "%s", ctime(&time));
}
- return(TRUE);
+ return EXIT_SUCCESS;
}
if (status != 0) {
perror(applet_name);
- exit(FALSE);
+ exit(EXIT_FAILURE);
}
}
}
}
endmntent(f);
- exit(TRUE);
+ exit(EXIT_SUCCESS);
}
}
}
swap_enable_disable(*argv);
- exit(TRUE);
+ return EXIT_SUCCESS;
usage_and_exit:
usage((whichApp == SWAPON_APP) ? swapon_usage : swapoff_usage);
- exit(FALSE);
}
mtab_read();
if (umountAll == TRUE) {
- exit(umount_all(useMtab));
+ if (umount_all(useMtab) == TRUE)
+ return EXIT_SUCCESS;
+ else
+ return EXIT_FAILURE;
}
if (do_umount(*argv, useMtab) == 0)
- exit(TRUE);
+ return EXIT_SUCCESS;
perror("umount");
- return(FALSE);
+ return EXIT_FAILURE;
}
}
if (optind == argc)
- exit_status = decode ("stdin", outname) == 0 ? TRUE : FALSE;
+ exit_status = decode ("stdin", outname) == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
else {
- exit_status = TRUE;
+ exit_status = EXIT_SUCCESS;
do {
if (freopen (argv[optind], "r", stdin) != NULL) {
if (decode (argv[optind], outname) != 0)
exit_status = FALSE;
} else {
errorMsg("%s: %s\n", argv[optind], strerror(errno));
- exit_status = FALSE;
+ exit_status = EXIT_FAILURE;
}
optind++;
}
/* Optional first argument is input file. */
if (!freopen (argv[optind], "r", stdin) || fstat (fileno (stdin), &sb)) {
errorMsg("%s: %s\n", argv[optind], strerror(errno));
- exit FALSE;
+ return EXIT_FAILURE;
}
mode = sb.st_mode & (S_IRWXU | S_IRWXG | S_IRWXO);
optind++;
printf(trans_ptr == uu_std ? "end\n" : "====\n");
if (ferror (stdout)) {
errorMsg("Write error\n");
- exit FALSE;
+ return EXIT_FAILURE;
}
- return( TRUE);
+ return EXIT_SUCCESS;
}
/* Copyright (c) 1983 Regents of the University of California.