Stop using TRUE and FALSE for exit status.
This commit is contained in:
parent
b558e76eb1
commit
3e856ce428
2
ar.c
2
ar.c
@ -387,5 +387,5 @@ extern int ar_main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
extractList=extractList->next;
|
extractList=extractList->next;
|
||||||
}
|
}
|
||||||
return (TRUE);
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
@ -387,5 +387,5 @@ extern int ar_main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
extractList=extractList->next;
|
extractList=extractList->next;
|
||||||
}
|
}
|
||||||
return (TRUE);
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
@ -1350,7 +1350,7 @@ int gunzip_main(int argc, char **argv)
|
|||||||
|
|
||||||
if (delInputFile == 1 && unlink(delFileName) < 0) {
|
if (delInputFile == 1 && unlink(delFileName) < 0) {
|
||||||
perror(delFileName);
|
perror(delFileName);
|
||||||
exit(FALSE);
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return(exit_code);
|
return(exit_code);
|
||||||
|
@ -1930,7 +1930,7 @@ int gzip_main(int argc, char **argv)
|
|||||||
|
|
||||||
if (unlink(delFileName) < 0) {
|
if (unlink(delFileName) < 0) {
|
||||||
perror(delFileName);
|
perror(delFileName);
|
||||||
exit(FALSE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -156,6 +156,7 @@ extern int tar_main(int argc, char **argv)
|
|||||||
int tostdoutFlag = FALSE;
|
int tostdoutFlag = FALSE;
|
||||||
int firstOpt = TRUE;
|
int firstOpt = TRUE;
|
||||||
int stopIt;
|
int stopIt;
|
||||||
|
int status;
|
||||||
|
|
||||||
|
|
||||||
if (argc <= 1)
|
if (argc <= 1)
|
||||||
@ -227,16 +228,21 @@ extern int tar_main(int argc, char **argv)
|
|||||||
#ifndef BB_FEATURE_TAR_CREATE
|
#ifndef BB_FEATURE_TAR_CREATE
|
||||||
fatalError( "This version of tar was not compiled with tar creation support.\n");
|
fatalError( "This version of tar was not compiled with tar creation support.\n");
|
||||||
#else
|
#else
|
||||||
exit(writeTarFile(tarName, verboseFlag, argv, excludeList));
|
status = writeTarFile(tarName, verboseFlag, argv, excludeList);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
if (listFlag == TRUE || extractFlag == TRUE) {
|
if (listFlag == TRUE || extractFlag == TRUE) {
|
||||||
if (*argv)
|
if (*argv)
|
||||||
extractList = argv;
|
extractList = argv;
|
||||||
exit(readTarFile(tarName, extractFlag, listFlag, tostdoutFlag,
|
status = readTarFile(tarName, extractFlag, listFlag, tostdoutFlag,
|
||||||
verboseFlag, extractList, excludeList));
|
verboseFlag, extractList, excludeList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (status == TRUE)
|
||||||
|
return EXIT_SUCCESS;
|
||||||
|
else
|
||||||
|
return EXIT_FAILURE;
|
||||||
|
|
||||||
flagError:
|
flagError:
|
||||||
fatalError( "Exactly one of 'c', 'x' or 't' must be specified\n");
|
fatalError( "Exactly one of 'c', 'x' or 't' must be specified\n");
|
||||||
}
|
}
|
||||||
|
@ -45,5 +45,5 @@ extern int basename_main(int argc, char **argv)
|
|||||||
s[m-n] = '\0';
|
s[m-n] = '\0';
|
||||||
}
|
}
|
||||||
printf("%s\n", s);
|
printf("%s\n", s);
|
||||||
return(TRUE);
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
@ -161,9 +161,9 @@ int chmod_chown_chgrp_main(int argc, char **argv)
|
|||||||
while (argc-- > 1) {
|
while (argc-- > 1) {
|
||||||
if (recursiveAction (*(++argv), recursiveFlag, FALSE, FALSE,
|
if (recursiveAction (*(++argv), recursiveFlag, FALSE, FALSE,
|
||||||
fileAction, fileAction, NULL) == FALSE)
|
fileAction, fileAction, NULL) == FALSE)
|
||||||
exit(FALSE);
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
exit(TRUE);
|
return EXIT_SUCCESS;
|
||||||
|
|
||||||
bad_group:
|
bad_group:
|
||||||
fatalError( "unknown group name: %s\n", groupName);
|
fatalError( "unknown group name: %s\n", groupName);
|
||||||
|
2
chroot.c
2
chroot.c
@ -54,7 +54,7 @@ int chroot_main(int argc, char **argv)
|
|||||||
execlp(prog, prog, NULL);
|
execlp(prog, prog, NULL);
|
||||||
#else
|
#else
|
||||||
shell_main(argc, argv);
|
shell_main(argc, argv);
|
||||||
exit (0);
|
return EXIT_SUCCESS;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
fatalError("cannot execute %s: %s\n", prog, strerror(errno));
|
fatalError("cannot execute %s: %s\n", prog, strerror(errno));
|
||||||
|
6
chvt.c
6
chvt.c
@ -25,13 +25,13 @@ int chvt_main(int argc, char **argv)
|
|||||||
num = atoi(argv[1]);
|
num = atoi(argv[1]);
|
||||||
if (ioctl(fd, VT_ACTIVATE, num)) {
|
if (ioctl(fd, VT_ACTIVATE, num)) {
|
||||||
perror("VT_ACTIVATE");
|
perror("VT_ACTIVATE");
|
||||||
exit(FALSE);
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
if (ioctl(fd, VT_WAITACTIVE, num)) {
|
if (ioctl(fd, VT_WAITACTIVE, num)) {
|
||||||
perror("VT_WAITACTIVE");
|
perror("VT_WAITACTIVE");
|
||||||
exit(FALSE);
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
return(TRUE);
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
2
clear.c
2
clear.c
@ -29,5 +29,5 @@
|
|||||||
extern int clear_main(int argc, char **argv)
|
extern int clear_main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
printf("\033[H\033[J");
|
printf("\033[H\033[J");
|
||||||
return(TRUE);
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
@ -135,7 +135,7 @@ void clean_up_and_die(int sig)
|
|||||||
cmdedit_reset_term();
|
cmdedit_reset_term();
|
||||||
fprintf(stdout, "\n");
|
fprintf(stdout, "\n");
|
||||||
if (sig!=SIGINT)
|
if (sig!=SIGINT)
|
||||||
exit(TRUE);
|
exit(EXIT_SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Go to HOME position */
|
/* Go to HOME position */
|
||||||
|
2
cmp.c
2
cmp.c
@ -54,7 +54,7 @@ int cmp_main(int argc, char **argv)
|
|||||||
else
|
else
|
||||||
printf("%s %s differ: char %d, line %d\n", filename1, filename2,
|
printf("%s %s differ: char %d, line %d\n", filename1, filename2,
|
||||||
char_pos, line_pos);
|
char_pos, line_pos);
|
||||||
return 1;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
char_pos++;
|
char_pos++;
|
||||||
if (c1 == '\n')
|
if (c1 == '\n')
|
||||||
|
@ -25,13 +25,13 @@ int chvt_main(int argc, char **argv)
|
|||||||
num = atoi(argv[1]);
|
num = atoi(argv[1]);
|
||||||
if (ioctl(fd, VT_ACTIVATE, num)) {
|
if (ioctl(fd, VT_ACTIVATE, num)) {
|
||||||
perror("VT_ACTIVATE");
|
perror("VT_ACTIVATE");
|
||||||
exit(FALSE);
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
if (ioctl(fd, VT_WAITACTIVE, num)) {
|
if (ioctl(fd, VT_WAITACTIVE, num)) {
|
||||||
perror("VT_WAITACTIVE");
|
perror("VT_WAITACTIVE");
|
||||||
exit(FALSE);
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
return(TRUE);
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -29,5 +29,5 @@
|
|||||||
extern int clear_main(int argc, char **argv)
|
extern int clear_main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
printf("\033[H\033[J");
|
printf("\033[H\033[J");
|
||||||
return(TRUE);
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,7 @@ printf("erik: A\n");
|
|||||||
/* deallocate all unused consoles */
|
/* deallocate all unused consoles */
|
||||||
if (ioctl(fd, VT_DISALLOCATE, 0)) {
|
if (ioctl(fd, VT_DISALLOCATE, 0)) {
|
||||||
perror("VT_DISALLOCATE");
|
perror("VT_DISALLOCATE");
|
||||||
exit( FALSE);
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
printf("erik: B\n");
|
printf("erik: B\n");
|
||||||
@ -44,5 +44,5 @@ printf("erik: B\n");
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
printf("erik: C\n");
|
printf("erik: C\n");
|
||||||
return( TRUE);
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
@ -51,7 +51,7 @@ int dumpkmap_main(int argc, char **argv)
|
|||||||
fd = open("/dev/tty0", O_RDWR);
|
fd = open("/dev/tty0", O_RDWR);
|
||||||
if (fd < 0) {
|
if (fd < 0) {
|
||||||
errorMsg("Error opening /dev/tty0: %s\n", strerror(errno));
|
errorMsg("Error opening /dev/tty0: %s\n", strerror(errno));
|
||||||
return 1;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
write(1, magic, 7);
|
write(1, magic, 7);
|
||||||
@ -88,5 +88,5 @@ int dumpkmap_main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
close(fd);
|
close(fd);
|
||||||
return 0;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
@ -40,17 +40,17 @@ int loadacm_main(int argc, char **argv)
|
|||||||
fd = open("/dev/tty", O_RDWR);
|
fd = open("/dev/tty", O_RDWR);
|
||||||
if (fd < 0) {
|
if (fd < 0) {
|
||||||
errorMsg("Error opening /dev/tty1: %s\n", strerror(errno));
|
errorMsg("Error opening /dev/tty1: %s\n", strerror(errno));
|
||||||
return( FALSE);
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (screen_map_load(fd, stdin)) {
|
if (screen_map_load(fd, stdin)) {
|
||||||
errorMsg("Error loading acm: %s\n", strerror(errno));
|
errorMsg("Error loading acm: %s\n", strerror(errno));
|
||||||
return( FALSE);
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
write(fd, "\033(K", 3);
|
write(fd, "\033(K", 3);
|
||||||
|
|
||||||
return( TRUE);
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
int screen_map_load(int fd, FILE * fp)
|
int screen_map_load(int fd, FILE * fp)
|
||||||
|
@ -29,6 +29,6 @@
|
|||||||
extern int reset_main(int argc, char **argv)
|
extern int reset_main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
printf("\033c");
|
printf("\033c");
|
||||||
return(TRUE);
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -68,5 +68,5 @@ setkeycodes_main(int argc, char** argv)
|
|||||||
argc -= 2;
|
argc -= 2;
|
||||||
argv += 2;
|
argv += 2;
|
||||||
}
|
}
|
||||||
return( TRUE);
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
@ -45,5 +45,5 @@ extern int basename_main(int argc, char **argv)
|
|||||||
s[m-n] = '\0';
|
s[m-n] = '\0';
|
||||||
}
|
}
|
||||||
printf("%s\n", s);
|
printf("%s\n", s);
|
||||||
return(TRUE);
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
@ -54,7 +54,7 @@ int chroot_main(int argc, char **argv)
|
|||||||
execlp(prog, prog, NULL);
|
execlp(prog, prog, NULL);
|
||||||
#else
|
#else
|
||||||
shell_main(argc, argv);
|
shell_main(argc, argv);
|
||||||
exit (0);
|
return EXIT_SUCCESS;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
fatalError("cannot execute %s: %s\n", prog, strerror(errno));
|
fatalError("cannot execute %s: %s\n", prog, strerror(errno));
|
||||||
|
@ -54,7 +54,7 @@ int cmp_main(int argc, char **argv)
|
|||||||
else
|
else
|
||||||
printf("%s %s differ: char %d, line %d\n", filename1, filename2,
|
printf("%s %s differ: char %d, line %d\n", filename1, filename2,
|
||||||
char_pos, line_pos);
|
char_pos, line_pos);
|
||||||
return 1;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
char_pos++;
|
char_pos++;
|
||||||
if (c1 == '\n')
|
if (c1 == '\n')
|
||||||
|
@ -241,5 +241,5 @@ extern int cut_main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
@ -232,7 +232,7 @@ int date_main(int argc, char **argv)
|
|||||||
} else if (*date_fmt == '\0') {
|
} else if (*date_fmt == '\0') {
|
||||||
/* Imitate what GNU 'date' does with NO format string! */
|
/* Imitate what GNU 'date' does with NO format string! */
|
||||||
printf("\n");
|
printf("\n");
|
||||||
exit(TRUE);
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Handle special conversions */
|
/* Handle special conversions */
|
||||||
@ -246,5 +246,5 @@ int date_main(int argc, char **argv)
|
|||||||
strftime(t_buff, 200, date_fmt, &tm_time);
|
strftime(t_buff, 200, date_fmt, &tm_time);
|
||||||
printf("%s\n", t_buff);
|
printf("%s\n", t_buff);
|
||||||
|
|
||||||
return(TRUE);
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
@ -174,7 +174,7 @@ extern int dd_main(int argc, char **argv)
|
|||||||
(inTotal % blockSize) != 0);
|
(inTotal % blockSize) != 0);
|
||||||
printf("%ld+%d records out\n", (long) (outTotal / blockSize),
|
printf("%ld+%d records out\n", (long) (outTotal / blockSize),
|
||||||
(outTotal % blockSize) != 0);
|
(outTotal % blockSize) != 0);
|
||||||
exit(TRUE);
|
return EXIT_SUCCESS;
|
||||||
usage:
|
usage:
|
||||||
|
|
||||||
usage(dd_usage);
|
usage(dd_usage);
|
||||||
|
@ -79,12 +79,12 @@ extern int df_main(int argc, char **argv)
|
|||||||
exit(FALSE);
|
exit(FALSE);
|
||||||
}
|
}
|
||||||
status = df(mountEntry->mnt_fsname, mountEntry->mnt_dir);
|
status = df(mountEntry->mnt_fsname, mountEntry->mnt_dir);
|
||||||
if (status != 0)
|
if (status != TRUE)
|
||||||
exit(status);
|
return EXIT_FAILURE;
|
||||||
argc--;
|
argc--;
|
||||||
argv++;
|
argv++;
|
||||||
}
|
}
|
||||||
exit(TRUE);
|
return EXIT_SUCCESS;
|
||||||
} else {
|
} else {
|
||||||
FILE *mountTable;
|
FILE *mountTable;
|
||||||
struct mntent *mountEntry;
|
struct mntent *mountEntry;
|
||||||
@ -92,7 +92,7 @@ extern int df_main(int argc, char **argv)
|
|||||||
mountTable = setmntent(mtab_file, "r");
|
mountTable = setmntent(mtab_file, "r");
|
||||||
if (mountTable == 0) {
|
if (mountTable == 0) {
|
||||||
perror(mtab_file);
|
perror(mtab_file);
|
||||||
exit(FALSE);
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
while ((mountEntry = getmntent(mountTable))) {
|
while ((mountEntry = getmntent(mountTable))) {
|
||||||
@ -101,7 +101,7 @@ extern int df_main(int argc, char **argv)
|
|||||||
endmntent(mountTable);
|
endmntent(mountTable);
|
||||||
}
|
}
|
||||||
|
|
||||||
return(TRUE);
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -40,5 +40,5 @@ extern int dirname_main(int argc, char **argv)
|
|||||||
if (s && *s)
|
if (s && *s)
|
||||||
*s = '\0';
|
*s = '\0';
|
||||||
printf("%s\n", (s)? *argv : ".");
|
printf("%s\n", (s)? *argv : ".");
|
||||||
return(TRUE);
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
@ -41,5 +41,5 @@ int dos2unix_main( int argc, char **argv ) {
|
|||||||
putchar(c);
|
putchar(c);
|
||||||
c = getchar();
|
c = getchar();
|
||||||
}
|
}
|
||||||
return 0;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
@ -160,10 +160,10 @@ int du_main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
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:
|
Local Variables:
|
||||||
c-file-style: "linux"
|
c-file-style: "linux"
|
||||||
|
@ -107,7 +107,7 @@ just_echo:
|
|||||||
putchar('\n');
|
putchar('\n');
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
|
|
||||||
return 0;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
|
@ -26,5 +26,5 @@
|
|||||||
extern int hostid_main(int argc, char **argv)
|
extern int hostid_main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
printf("%lx\n", gethostid());
|
printf("%lx\n", gethostid());
|
||||||
return(TRUE);
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
@ -9,5 +9,5 @@ extern int length_main(int argc, char **argv)
|
|||||||
if (argc != 2 || **(argv + 1) == '-')
|
if (argc != 2 || **(argv + 1) == '-')
|
||||||
usage(length_usage);
|
usage(length_usage);
|
||||||
printf("%lu\n", (long)strlen(argv[1]));
|
printf("%lu\n", (long)strlen(argv[1]));
|
||||||
return (TRUE);
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
@ -878,5 +878,4 @@ extern int ls_main(int argc, char **argv)
|
|||||||
|
|
||||||
print_usage_message:
|
print_usage_message:
|
||||||
usage(ls_usage);
|
usage(ls_usage);
|
||||||
return(FALSE);
|
|
||||||
}
|
}
|
||||||
|
@ -902,22 +902,22 @@ int md5sum_main(int argc,
|
|||||||
|
|
||||||
if (file_type_specified && do_check) {
|
if (file_type_specified && do_check) {
|
||||||
errorMsg("the -b and -t options are meaningless when verifying checksums\n");
|
errorMsg("the -b and -t options are meaningless when verifying checksums\n");
|
||||||
exit FALSE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (n_strings > 0 && do_check) {
|
if (n_strings > 0 && do_check) {
|
||||||
errorMsg("the -g and -c options are mutually exclusive\n");
|
errorMsg("the -g and -c options are mutually exclusive\n");
|
||||||
exit FALSE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (status_only && !do_check) {
|
if (status_only && !do_check) {
|
||||||
errorMsg("the -s option is meaningful only when verifying checksums\n");
|
errorMsg("the -s option is meaningful only when verifying checksums\n");
|
||||||
exit FALSE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (warn && !do_check) {
|
if (warn && !do_check) {
|
||||||
errorMsg("the -w option is meaningful only when verifying checksums\n");
|
errorMsg("the -w option is meaningful only when verifying checksums\n");
|
||||||
exit FALSE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (n_strings > 0) {
|
if (n_strings > 0) {
|
||||||
@ -925,7 +925,7 @@ int md5sum_main(int argc,
|
|||||||
|
|
||||||
if (optind < argc) {
|
if (optind < argc) {
|
||||||
errorMsg("no files may be specified when using -g\n");
|
errorMsg("no files may be specified when using -g\n");
|
||||||
exit FALSE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
for (i = 0; i < n_strings; ++i) {
|
for (i = 0; i < n_strings; ++i) {
|
||||||
size_t cnt;
|
size_t cnt;
|
||||||
@ -992,13 +992,16 @@ int md5sum_main(int argc,
|
|||||||
|
|
||||||
if (fclose (stdout) == EOF) {
|
if (fclose (stdout) == EOF) {
|
||||||
errorMsg("write error\n");
|
errorMsg("write error\n");
|
||||||
exit FALSE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (have_read_stdin && fclose (stdin) == EOF) {
|
if (have_read_stdin && fclose (stdin) == EOF) {
|
||||||
errorMsg("standard input\n");
|
errorMsg("standard input\n");
|
||||||
exit FALSE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
exit (err == 0 ? TRUE : FALSE);
|
if (err == 0)
|
||||||
|
return EXIT_SUCCESS;
|
||||||
|
else
|
||||||
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
@ -51,7 +51,7 @@ extern int mkdir_main(int argc, char **argv)
|
|||||||
mode = 0;
|
mode = 0;
|
||||||
if (parse_mode(*(++argv), &mode) == FALSE) {
|
if (parse_mode(*(++argv), &mode) == FALSE) {
|
||||||
errorMsg("Unknown mode: %s\n", *argv);
|
errorMsg("Unknown mode: %s\n", *argv);
|
||||||
exit FALSE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
/* Set the umask for this process so it doesn't
|
/* Set the umask for this process so it doesn't
|
||||||
* screw up whatever the user just entered. */
|
* screw up whatever the user just entered. */
|
||||||
@ -80,13 +80,13 @@ extern int mkdir_main(int argc, char **argv)
|
|||||||
|
|
||||||
if (strlen(*argv) > BUFSIZ - 1) {
|
if (strlen(*argv) > BUFSIZ - 1) {
|
||||||
errorMsg(name_too_long);
|
errorMsg(name_too_long);
|
||||||
exit FALSE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
strcpy(buf, *argv);
|
strcpy(buf, *argv);
|
||||||
status = stat(buf, &statBuf);
|
status = stat(buf, &statBuf);
|
||||||
if (parentFlag == FALSE && status != -1 && errno != ENOENT) {
|
if (parentFlag == FALSE && status != -1 && errno != ENOENT) {
|
||||||
errorMsg("%s: File exists\n", buf);
|
errorMsg("%s: File exists\n", buf);
|
||||||
exit FALSE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
if (parentFlag == TRUE) {
|
if (parentFlag == TRUE) {
|
||||||
strcat(buf, "/");
|
strcat(buf, "/");
|
||||||
@ -94,11 +94,11 @@ extern int mkdir_main(int argc, char **argv)
|
|||||||
} else {
|
} else {
|
||||||
if (mkdir(buf, mode) != 0 && parentFlag == FALSE) {
|
if (mkdir(buf, mode) != 0 && parentFlag == FALSE) {
|
||||||
perror(buf);
|
perror(buf);
|
||||||
exit FALSE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
argc--;
|
argc--;
|
||||||
argv++;
|
argv++;
|
||||||
}
|
}
|
||||||
return( TRUE);
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
@ -55,7 +55,7 @@ extern int mkfifo_main(int argc, char **argv)
|
|||||||
usage(mkfifo_usage);
|
usage(mkfifo_usage);
|
||||||
if (mkfifo(*argv, mode) < 0) {
|
if (mkfifo(*argv, mode) < 0) {
|
||||||
perror("mkfifo");
|
perror("mkfifo");
|
||||||
exit(255);
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
return(TRUE);
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
@ -85,6 +85,6 @@ int mknod_main(int argc, char **argv)
|
|||||||
|
|
||||||
if (mknod(argv[0], mode, dev) != 0)
|
if (mknod(argv[0], mode, dev) != 0)
|
||||||
fatalError("%s: %s\n", argv[0], strerror(errno));
|
fatalError("%s: %s\n", argv[0], strerror(errno));
|
||||||
return (TRUE);
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -34,5 +34,5 @@ extern int pwd_main(int argc, char **argv)
|
|||||||
fatalError("%s\n", strerror(errno));
|
fatalError("%s\n", strerror(errno));
|
||||||
|
|
||||||
printf("%s\n", buf);
|
printf("%s\n", buf);
|
||||||
return(TRUE);
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
@ -102,9 +102,9 @@ extern int rm_main(int argc, char **argv)
|
|||||||
} else {
|
} else {
|
||||||
if (recursiveAction(srcName, recursiveFlag, FALSE,
|
if (recursiveAction(srcName, recursiveFlag, FALSE,
|
||||||
TRUE, fileAction, dirAction, NULL) == FALSE) {
|
TRUE, fileAction, dirAction, NULL) == FALSE) {
|
||||||
exit(FALSE);
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return(TRUE);
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
@ -32,7 +32,7 @@ extern int sleep_main(int argc, char **argv)
|
|||||||
|
|
||||||
if (sleep(atoi(*(++argv))) != 0) {
|
if (sleep(atoi(*(++argv))) != 0) {
|
||||||
perror("sleep");
|
perror("sleep");
|
||||||
exit(FALSE);
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
return(TRUE);
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
@ -43,7 +43,6 @@ extern int touch_main(int argc, char **argv)
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
usage(touch_usage);
|
usage(touch_usage);
|
||||||
exit(FALSE);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -57,7 +56,7 @@ extern int touch_main(int argc, char **argv)
|
|||||||
S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH);
|
S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH);
|
||||||
if (fd < 0) {
|
if (fd < 0) {
|
||||||
if (create == FALSE && errno == ENOENT)
|
if (create == FALSE && errno == ENOENT)
|
||||||
exit(TRUE);
|
return EXIT_SUCCESS;
|
||||||
else {
|
else {
|
||||||
fatalError("%s", strerror(errno));
|
fatalError("%s", strerror(errno));
|
||||||
}
|
}
|
||||||
@ -70,5 +69,5 @@ extern int touch_main(int argc, char **argv)
|
|||||||
argv++;
|
argv++;
|
||||||
}
|
}
|
||||||
|
|
||||||
return(TRUE);
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
@ -38,5 +38,5 @@ extern int tty_main(int argc, char **argv)
|
|||||||
else
|
else
|
||||||
puts("not a tty");
|
puts("not a tty");
|
||||||
}
|
}
|
||||||
return(isatty(0) ? TRUE : FALSE);
|
return(isatty(0) ? EXIT_SUCCESS : EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
@ -138,7 +138,7 @@ int uname_main(int argc, char **argv)
|
|||||||
print_element(PRINT_MACHINE, name.machine);
|
print_element(PRINT_MACHINE, name.machine);
|
||||||
print_element(PRINT_PROCESSOR, processor);
|
print_element(PRINT_PROCESSOR, processor);
|
||||||
|
|
||||||
return(TRUE);
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If the name element set in MASK is selected for printing in `toprint',
|
/* If the name element set in MASK is selected for printing in `toprint',
|
||||||
|
@ -32,5 +32,5 @@ extern int usleep_main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
usleep(atoi(*(++argv))); /* return void */
|
usleep(atoi(*(++argv))); /* return void */
|
||||||
return(TRUE);
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
@ -294,16 +294,16 @@ int uudecode_main (int argc,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (optind == argc)
|
if (optind == argc)
|
||||||
exit_status = decode ("stdin", outname) == 0 ? TRUE : FALSE;
|
exit_status = decode ("stdin", outname) == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
|
||||||
else {
|
else {
|
||||||
exit_status = TRUE;
|
exit_status = EXIT_SUCCESS;
|
||||||
do {
|
do {
|
||||||
if (freopen (argv[optind], "r", stdin) != NULL) {
|
if (freopen (argv[optind], "r", stdin) != NULL) {
|
||||||
if (decode (argv[optind], outname) != 0)
|
if (decode (argv[optind], outname) != 0)
|
||||||
exit_status = FALSE;
|
exit_status = FALSE;
|
||||||
} else {
|
} else {
|
||||||
errorMsg("%s: %s\n", argv[optind], strerror(errno));
|
errorMsg("%s: %s\n", argv[optind], strerror(errno));
|
||||||
exit_status = FALSE;
|
exit_status = EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
optind++;
|
optind++;
|
||||||
}
|
}
|
||||||
|
@ -179,7 +179,7 @@ int uuencode_main (int argc,
|
|||||||
/* Optional first argument is input file. */
|
/* Optional first argument is input file. */
|
||||||
if (!freopen (argv[optind], "r", stdin) || fstat (fileno (stdin), &sb)) {
|
if (!freopen (argv[optind], "r", stdin) || fstat (fileno (stdin), &sb)) {
|
||||||
errorMsg("%s: %s\n", argv[optind], strerror(errno));
|
errorMsg("%s: %s\n", argv[optind], strerror(errno));
|
||||||
exit FALSE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
mode = sb.st_mode & (S_IRWXU | S_IRWXG | S_IRWXO);
|
mode = sb.st_mode & (S_IRWXU | S_IRWXG | S_IRWXO);
|
||||||
optind++;
|
optind++;
|
||||||
@ -200,9 +200,9 @@ int uuencode_main (int argc,
|
|||||||
printf(trans_ptr == uu_std ? "end\n" : "====\n");
|
printf(trans_ptr == uu_std ? "end\n" : "====\n");
|
||||||
if (ferror (stdout)) {
|
if (ferror (stdout)) {
|
||||||
errorMsg("Write error\n");
|
errorMsg("Write error\n");
|
||||||
exit FALSE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
return( TRUE);
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Copyright (c) 1983 Regents of the University of California.
|
/* Copyright (c) 1983 Regents of the University of California.
|
||||||
|
4
cp_mv.c
4
cp_mv.c
@ -316,9 +316,9 @@ extern int cp_mv_main(int argc, char **argv)
|
|||||||
if (flags_memo)
|
if (flags_memo)
|
||||||
*(baseDestName + baseDestLen) = '\0';
|
*(baseDestName + baseDestLen) = '\0';
|
||||||
}
|
}
|
||||||
return( TRUE);
|
return EXIT_SUCCESS;
|
||||||
exit_false:
|
exit_false:
|
||||||
return( FALSE);
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
2
cut.c
2
cut.c
@ -241,5 +241,5 @@ extern int cut_main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
4
date.c
4
date.c
@ -232,7 +232,7 @@ int date_main(int argc, char **argv)
|
|||||||
} else if (*date_fmt == '\0') {
|
} else if (*date_fmt == '\0') {
|
||||||
/* Imitate what GNU 'date' does with NO format string! */
|
/* Imitate what GNU 'date' does with NO format string! */
|
||||||
printf("\n");
|
printf("\n");
|
||||||
exit(TRUE);
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Handle special conversions */
|
/* Handle special conversions */
|
||||||
@ -246,5 +246,5 @@ int date_main(int argc, char **argv)
|
|||||||
strftime(t_buff, 200, date_fmt, &tm_time);
|
strftime(t_buff, 200, date_fmt, &tm_time);
|
||||||
printf("%s\n", t_buff);
|
printf("%s\n", t_buff);
|
||||||
|
|
||||||
return(TRUE);
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
19
dc.c
19
dc.c
@ -13,19 +13,15 @@ static unsigned int pointer;
|
|||||||
|
|
||||||
static void push(double a)
|
static void push(double a)
|
||||||
{
|
{
|
||||||
if (pointer >= (sizeof(stack) / sizeof(*stack))) {
|
if (pointer >= (sizeof(stack) / sizeof(*stack)))
|
||||||
errorMsg("stack overflow\n");
|
fatalError("stack overflow\n");
|
||||||
exit(-1);
|
stack[pointer++] = a;
|
||||||
} else
|
|
||||||
stack[pointer++] = a;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static double pop()
|
static double pop()
|
||||||
{
|
{
|
||||||
if (pointer == 0) {
|
if (pointer == 0)
|
||||||
errorMsg("stack underflow\n");
|
fatalError("stack underflow\n");
|
||||||
exit(-1);
|
|
||||||
}
|
|
||||||
return stack[--pointer];
|
return stack[--pointer];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -124,8 +120,7 @@ static void stack_machine(const char *argument)
|
|||||||
}
|
}
|
||||||
o++;
|
o++;
|
||||||
}
|
}
|
||||||
errorMsg("%s: syntax error.\n", argument);
|
fatalError("%s: syntax error.\n", argument);
|
||||||
exit(-1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* return pointer to next token in buffer and set *buffer to one char
|
/* return pointer to next token in buffer and set *buffer to one char
|
||||||
@ -182,5 +177,5 @@ int dc_main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
stack_machine(0);
|
stack_machine(0);
|
||||||
return( TRUE);
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
2
dd.c
2
dd.c
@ -174,7 +174,7 @@ extern int dd_main(int argc, char **argv)
|
|||||||
(inTotal % blockSize) != 0);
|
(inTotal % blockSize) != 0);
|
||||||
printf("%ld+%d records out\n", (long) (outTotal / blockSize),
|
printf("%ld+%d records out\n", (long) (outTotal / blockSize),
|
||||||
(outTotal % blockSize) != 0);
|
(outTotal % blockSize) != 0);
|
||||||
exit(TRUE);
|
return EXIT_SUCCESS;
|
||||||
usage:
|
usage:
|
||||||
|
|
||||||
usage(dd_usage);
|
usage(dd_usage);
|
||||||
|
@ -28,7 +28,7 @@ printf("erik: A\n");
|
|||||||
/* deallocate all unused consoles */
|
/* deallocate all unused consoles */
|
||||||
if (ioctl(fd, VT_DISALLOCATE, 0)) {
|
if (ioctl(fd, VT_DISALLOCATE, 0)) {
|
||||||
perror("VT_DISALLOCATE");
|
perror("VT_DISALLOCATE");
|
||||||
exit( FALSE);
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
printf("erik: B\n");
|
printf("erik: B\n");
|
||||||
@ -44,5 +44,5 @@ printf("erik: B\n");
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
printf("erik: C\n");
|
printf("erik: C\n");
|
||||||
return( TRUE);
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
10
df.c
10
df.c
@ -79,12 +79,12 @@ extern int df_main(int argc, char **argv)
|
|||||||
exit(FALSE);
|
exit(FALSE);
|
||||||
}
|
}
|
||||||
status = df(mountEntry->mnt_fsname, mountEntry->mnt_dir);
|
status = df(mountEntry->mnt_fsname, mountEntry->mnt_dir);
|
||||||
if (status != 0)
|
if (status != TRUE)
|
||||||
exit(status);
|
return EXIT_FAILURE;
|
||||||
argc--;
|
argc--;
|
||||||
argv++;
|
argv++;
|
||||||
}
|
}
|
||||||
exit(TRUE);
|
return EXIT_SUCCESS;
|
||||||
} else {
|
} else {
|
||||||
FILE *mountTable;
|
FILE *mountTable;
|
||||||
struct mntent *mountEntry;
|
struct mntent *mountEntry;
|
||||||
@ -92,7 +92,7 @@ extern int df_main(int argc, char **argv)
|
|||||||
mountTable = setmntent(mtab_file, "r");
|
mountTable = setmntent(mtab_file, "r");
|
||||||
if (mountTable == 0) {
|
if (mountTable == 0) {
|
||||||
perror(mtab_file);
|
perror(mtab_file);
|
||||||
exit(FALSE);
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
while ((mountEntry = getmntent(mountTable))) {
|
while ((mountEntry = getmntent(mountTable))) {
|
||||||
@ -101,7 +101,7 @@ extern int df_main(int argc, char **argv)
|
|||||||
endmntent(mountTable);
|
endmntent(mountTable);
|
||||||
}
|
}
|
||||||
|
|
||||||
return(TRUE);
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -40,5 +40,5 @@ extern int dirname_main(int argc, char **argv)
|
|||||||
if (s && *s)
|
if (s && *s)
|
||||||
*s = '\0';
|
*s = '\0';
|
||||||
printf("%s\n", (s)? *argv : ".");
|
printf("%s\n", (s)? *argv : ".");
|
||||||
return(TRUE);
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
8
dmesg.c
8
dmesg.c
@ -73,7 +73,7 @@ int dmesg_main(int argc, char **argv)
|
|||||||
if (n < 0) {
|
if (n < 0) {
|
||||||
goto klogctl_error;
|
goto klogctl_error;
|
||||||
}
|
}
|
||||||
exit(TRUE);
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bufsize < 4096)
|
if (bufsize < 4096)
|
||||||
@ -98,11 +98,11 @@ int dmesg_main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
if (lastc != '\n')
|
if (lastc != '\n')
|
||||||
putchar('\n');
|
putchar('\n');
|
||||||
exit(TRUE);
|
return EXIT_SUCCESS;
|
||||||
end:
|
end:
|
||||||
usage(dmesg_usage);
|
usage(dmesg_usage);
|
||||||
exit(FALSE);
|
return EXIT_FAILURE;
|
||||||
klogctl_error:
|
klogctl_error:
|
||||||
perror("klogctl");
|
perror("klogctl");
|
||||||
return(FALSE);
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
@ -41,5 +41,5 @@ int dos2unix_main( int argc, char **argv ) {
|
|||||||
putchar(c);
|
putchar(c);
|
||||||
c = getchar();
|
c = getchar();
|
||||||
}
|
}
|
||||||
return 0;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
4
du.c
4
du.c
@ -160,10 +160,10 @@ int du_main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
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:
|
Local Variables:
|
||||||
c-file-style: "linux"
|
c-file-style: "linux"
|
||||||
|
@ -51,7 +51,7 @@ int dumpkmap_main(int argc, char **argv)
|
|||||||
fd = open("/dev/tty0", O_RDWR);
|
fd = open("/dev/tty0", O_RDWR);
|
||||||
if (fd < 0) {
|
if (fd < 0) {
|
||||||
errorMsg("Error opening /dev/tty0: %s\n", strerror(errno));
|
errorMsg("Error opening /dev/tty0: %s\n", strerror(errno));
|
||||||
return 1;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
write(1, magic, 7);
|
write(1, magic, 7);
|
||||||
@ -88,5 +88,5 @@ int dumpkmap_main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
close(fd);
|
close(fd);
|
||||||
return 0;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
2
dutmp.c
2
dutmp.c
@ -62,5 +62,5 @@ extern int dutmp_main(int argc, char **argv)
|
|||||||
ut.ut_addr);
|
ut.ut_addr);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
return(TRUE);
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
2
echo.c
2
echo.c
@ -107,7 +107,7 @@ just_echo:
|
|||||||
putchar('\n');
|
putchar('\n');
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
|
|
||||||
return 0;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
|
4
fbset.c
4
fbset.c
@ -434,7 +434,7 @@ extern int fbset_main(int argc, char **argv)
|
|||||||
if (g_options & OPT_READMODE) {
|
if (g_options & OPT_READMODE) {
|
||||||
if (!readmode(&var, modefile, mode)) {
|
if (!readmode(&var, modefile, mode)) {
|
||||||
errorMsg("Unknown video mode `%s'\n", mode);
|
errorMsg("Unknown video mode `%s'\n", mode);
|
||||||
exit(1);
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -446,5 +446,5 @@ extern int fbset_main(int argc, char **argv)
|
|||||||
/* Don't close the file, as exiting will take care of that */
|
/* Don't close the file, as exiting will take care of that */
|
||||||
/* close(fh); */
|
/* close(fh); */
|
||||||
|
|
||||||
return (TRUE);
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
@ -40,7 +40,7 @@ extern int fdflush_main(int argc, char **argv)
|
|||||||
fd = open(*argv, 0);
|
fd = open(*argv, 0);
|
||||||
if (fd < 0) {
|
if (fd < 0) {
|
||||||
perror(*argv);
|
perror(*argv);
|
||||||
exit(FALSE);
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
value = ioctl(fd, FDFLUSH, 0);
|
value = ioctl(fd, FDFLUSH, 0);
|
||||||
@ -50,7 +50,7 @@ extern int fdflush_main(int argc, char **argv)
|
|||||||
|
|
||||||
if (value) {
|
if (value) {
|
||||||
perror(*argv);
|
perror(*argv);
|
||||||
exit(FALSE);
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
return(TRUE);
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
4
find.c
4
find.c
@ -100,8 +100,8 @@ int find_main(int argc, char **argv)
|
|||||||
|
|
||||||
if (recursiveAction(directory, TRUE, FALSE, FALSE,
|
if (recursiveAction(directory, TRUE, FALSE, FALSE,
|
||||||
fileAction, fileAction, NULL) == FALSE) {
|
fileAction, fileAction, NULL) == FALSE) {
|
||||||
exit(FALSE);
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
return(TRUE);
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
@ -100,8 +100,8 @@ int find_main(int argc, char **argv)
|
|||||||
|
|
||||||
if (recursiveAction(directory, TRUE, FALSE, FALSE,
|
if (recursiveAction(directory, TRUE, FALSE, FALSE,
|
||||||
fileAction, fileAction, NULL) == FALSE) {
|
fileAction, fileAction, NULL) == FALSE) {
|
||||||
exit(FALSE);
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
return(TRUE);
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
2
free.c
2
free.c
@ -60,7 +60,7 @@ extern int free_main(int argc, char **argv)
|
|||||||
printf("%6s%13ld%13ld%13ld\n", "Total:", info.totalram+info.totalswap,
|
printf("%6s%13ld%13ld%13ld\n", "Total:", info.totalram+info.totalswap,
|
||||||
(info.totalram-info.freeram)+(info.totalswap-info.freeswap),
|
(info.totalram-info.freeram)+(info.totalswap-info.freeswap),
|
||||||
info.freeram+info.freeswap);
|
info.freeram+info.freeswap);
|
||||||
return(TRUE);
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -51,7 +51,7 @@ freeramdisk_main(int argc, char **argv)
|
|||||||
/* Don't bother closing. Exit does
|
/* Don't bother closing. Exit does
|
||||||
* that, so we can save a few bytes */
|
* that, so we can save a few bytes */
|
||||||
/* close(f); */
|
/* close(f); */
|
||||||
return(TRUE);
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
2
gunzip.c
2
gunzip.c
@ -1350,7 +1350,7 @@ int gunzip_main(int argc, char **argv)
|
|||||||
|
|
||||||
if (delInputFile == 1 && unlink(delFileName) < 0) {
|
if (delInputFile == 1 && unlink(delFileName) < 0) {
|
||||||
perror(delFileName);
|
perror(delFileName);
|
||||||
exit(FALSE);
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return(exit_code);
|
return(exit_code);
|
||||||
|
2
gzip.c
2
gzip.c
@ -1930,7 +1930,7 @@ int gzip_main(int argc, char **argv)
|
|||||||
|
|
||||||
if (unlink(delFileName) < 0) {
|
if (unlink(delFileName) < 0) {
|
||||||
perror(delFileName);
|
perror(delFileName);
|
||||||
exit(FALSE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
2
hostid.c
2
hostid.c
@ -26,5 +26,5 @@
|
|||||||
extern int hostid_main(int argc, char **argv)
|
extern int hostid_main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
printf("%lx\n", gethostid());
|
printf("%lx\n", gethostid());
|
||||||
return(TRUE);
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
12
insmod.c
12
insmod.c
@ -77,7 +77,7 @@
|
|||||||
#ifndef MODUTILS_MODULE_H
|
#ifndef MODUTILS_MODULE_H
|
||||||
#define MODUTILS_MODULE_H 1
|
#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.
|
/* 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
|
We do not use the kernel headers directly because we do not wish
|
||||||
@ -283,7 +283,7 @@ int delete_module(const char *);
|
|||||||
#ifndef MODUTILS_OBJ_H
|
#ifndef MODUTILS_OBJ_H
|
||||||
#define MODUTILS_OBJ_H 1
|
#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. */
|
/* The relocatable object is manipulated using elfin types. */
|
||||||
|
|
||||||
@ -2769,7 +2769,7 @@ extern int insmod_main( int argc, char **argv)
|
|||||||
FILE *fp;
|
FILE *fp;
|
||||||
struct obj_file *f;
|
struct obj_file *f;
|
||||||
char m_name[BUFSIZ + 1] = "\0";
|
char m_name[BUFSIZ + 1] = "\0";
|
||||||
int exit_status = FALSE;
|
int exit_status = EXIT_FAILURE;
|
||||||
int m_has_modinfo;
|
int m_has_modinfo;
|
||||||
#ifdef BB_FEATURE_INSMOD_VERSION_CHECKING
|
#ifdef BB_FEATURE_INSMOD_VERSION_CHECKING
|
||||||
int k_version;
|
int k_version;
|
||||||
@ -2833,7 +2833,7 @@ extern int insmod_main( int argc, char **argv)
|
|||||||
|| ((fp = fopen(m_filename, "r")) == NULL))
|
|| ((fp = fopen(m_filename, "r")) == NULL))
|
||||||
{
|
{
|
||||||
errorMsg("No module named '%s' found in '%s'\n", m_fullName, _PATH_MODULES);
|
errorMsg("No module named '%s' found in '%s'\n", m_fullName, _PATH_MODULES);
|
||||||
exit(FALSE);
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
fatalError("No module named '%s' found in '%s'\n", m_fullName, _PATH_MODULES);
|
fatalError("No module named '%s' found in '%s'\n", m_fullName, _PATH_MODULES);
|
||||||
@ -2843,7 +2843,7 @@ extern int insmod_main( int argc, char **argv)
|
|||||||
|
|
||||||
if ((f = obj_load(fp)) == NULL) {
|
if ((f = obj_load(fp)) == NULL) {
|
||||||
perror("Could not load the module\n");
|
perror("Could not load the module\n");
|
||||||
exit(FALSE);
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (get_modinfo_value(f, "kernel_version") == NULL)
|
if (get_modinfo_value(f, "kernel_version") == NULL)
|
||||||
@ -2981,7 +2981,7 @@ extern int insmod_main( int argc, char **argv)
|
|||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
exit_status = TRUE;
|
exit_status = EXIT_SUCCESS;
|
||||||
|
|
||||||
out:
|
out:
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
|
7
kill.c
7
kill.c
@ -158,7 +158,7 @@ extern int kill_main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
fprintf(stderr, "\n\n");
|
fprintf(stderr, "\n\n");
|
||||||
exit(TRUE);
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case '-':
|
case '-':
|
||||||
@ -236,11 +236,12 @@ extern int kill_main(int argc, char **argv)
|
|||||||
* upon exit, so we can save a byte or two */
|
* upon exit, so we can save a byte or two */
|
||||||
argv++;
|
argv++;
|
||||||
}
|
}
|
||||||
exit (all_found);
|
if (all_found == FALSE)
|
||||||
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
exit(TRUE);
|
return EXIT_SUCCESS;
|
||||||
|
|
||||||
|
|
||||||
end:
|
end:
|
||||||
|
42
lash.c
42
lash.c
@ -217,11 +217,11 @@ static int builtin_cd(struct job *cmd, struct jobSet *junk)
|
|||||||
newdir = cmd->progs[0].argv[1];
|
newdir = cmd->progs[0].argv[1];
|
||||||
if (chdir(newdir)) {
|
if (chdir(newdir)) {
|
||||||
printf("cd: %s: %s\n", newdir, strerror(errno));
|
printf("cd: %s: %s\n", newdir, strerror(errno));
|
||||||
return FALSE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
getcwd(cwd, sizeof(char)*MAX_LINE);
|
getcwd(cwd, sizeof(char)*MAX_LINE);
|
||||||
|
|
||||||
return TRUE;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* built-in 'env' handler */
|
/* built-in 'env' handler */
|
||||||
@ -245,14 +245,14 @@ static int builtin_exec(struct job *cmd, struct jobSet *junk)
|
|||||||
fatalError("Exec to %s failed: %s\n", cmd->progs[0].argv[0],
|
fatalError("Exec to %s failed: %s\n", cmd->progs[0].argv[0],
|
||||||
strerror(errno));
|
strerror(errno));
|
||||||
}
|
}
|
||||||
return TRUE;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* built-in 'exit' handler */
|
/* built-in 'exit' handler */
|
||||||
static int builtin_exit(struct job *cmd, struct jobSet *junk)
|
static int builtin_exit(struct job *cmd, struct jobSet *junk)
|
||||||
{
|
{
|
||||||
if (!cmd->progs[0].argv[1] == 1)
|
if (!cmd->progs[0].argv[1] == 1)
|
||||||
exit TRUE;
|
exit(EXIT_SUCCESS);
|
||||||
|
|
||||||
exit (atoi(cmd->progs[0].argv[1]));
|
exit (atoi(cmd->progs[0].argv[1]));
|
||||||
}
|
}
|
||||||
@ -267,12 +267,12 @@ static int builtin_fg_bg(struct job *cmd, struct jobSet *jobList)
|
|||||||
if (!cmd->progs[0].argv[1] || cmd->progs[0].argv[2]) {
|
if (!cmd->progs[0].argv[1] || cmd->progs[0].argv[2]) {
|
||||||
errorMsg("%s: exactly one argument is expected\n",
|
errorMsg("%s: exactly one argument is expected\n",
|
||||||
cmd->progs[0].argv[0]);
|
cmd->progs[0].argv[0]);
|
||||||
return FALSE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
if (sscanf(cmd->progs[0].argv[1], "%%%d", &jobNum) != 1) {
|
if (sscanf(cmd->progs[0].argv[1], "%%%d", &jobNum) != 1) {
|
||||||
errorMsg("%s: bad argument '%s'\n",
|
errorMsg("%s: bad argument '%s'\n",
|
||||||
cmd->progs[0].argv[0], cmd->progs[0].argv[1]);
|
cmd->progs[0].argv[0], cmd->progs[0].argv[1]);
|
||||||
return FALSE;
|
return EXIT_FAILURE;
|
||||||
for (job = jobList->head; job; job = job->next) {
|
for (job = jobList->head; job; job = job->next) {
|
||||||
if (job->jobId == jobNum) {
|
if (job->jobId == jobNum) {
|
||||||
break;
|
break;
|
||||||
@ -286,7 +286,7 @@ static int builtin_fg_bg(struct job *cmd, struct jobSet *jobList)
|
|||||||
if (!job) {
|
if (!job) {
|
||||||
errorMsg("%s: unknown job %d\n",
|
errorMsg("%s: unknown job %d\n",
|
||||||
cmd->progs[0].argv[0], jobNum);
|
cmd->progs[0].argv[0], jobNum);
|
||||||
return FALSE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (*cmd->progs[0].argv[0] == 'f') {
|
if (*cmd->progs[0].argv[0] == 'f') {
|
||||||
@ -305,7 +305,7 @@ static int builtin_fg_bg(struct job *cmd, struct jobSet *jobList)
|
|||||||
|
|
||||||
job->stoppedProgs = 0;
|
job->stoppedProgs = 0;
|
||||||
|
|
||||||
return TRUE;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* built-in 'help' handler */
|
/* built-in 'help' handler */
|
||||||
@ -326,7 +326,7 @@ static int builtin_help(struct job *dummy, struct jobSet *junk)
|
|||||||
fprintf(stdout, "%s\t%s\n", x->cmd, x->descr);
|
fprintf(stdout, "%s\t%s\n", x->cmd, x->descr);
|
||||||
}
|
}
|
||||||
fprintf(stdout, "\n\n");
|
fprintf(stdout, "\n\n");
|
||||||
return TRUE;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* built-in 'jobs' handler */
|
/* built-in 'jobs' handler */
|
||||||
@ -343,7 +343,7 @@ static int builtin_jobs(struct job *dummy, struct jobSet *jobList)
|
|||||||
|
|
||||||
printf(JOB_STATUS_FORMAT, job->jobId, statusString, job->text);
|
printf(JOB_STATUS_FORMAT, job->jobId, statusString, job->text);
|
||||||
}
|
}
|
||||||
return TRUE;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -352,7 +352,7 @@ static int builtin_pwd(struct job *dummy, struct jobSet *junk)
|
|||||||
{
|
{
|
||||||
getcwd(cwd, sizeof(char)*MAX_LINE);
|
getcwd(cwd, sizeof(char)*MAX_LINE);
|
||||||
fprintf(stdout, "%s\n", cwd);
|
fprintf(stdout, "%s\n", cwd);
|
||||||
return TRUE;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* built-in 'export VAR=value' handler */
|
/* built-in 'export VAR=value' handler */
|
||||||
@ -437,11 +437,11 @@ static int builtin_then(struct job *cmd, struct jobSet *junk)
|
|||||||
|
|
||||||
if (! (cmd->jobContext & (IF_TRUE_CONTEXT|IF_FALSE_CONTEXT))) {
|
if (! (cmd->jobContext & (IF_TRUE_CONTEXT|IF_FALSE_CONTEXT))) {
|
||||||
errorMsg("unexpected token `then'\n");
|
errorMsg("unexpected token `then'\n");
|
||||||
return FALSE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
/* If the if result was FALSE, skip the 'then' stuff */
|
/* If the if result was FALSE, skip the 'then' stuff */
|
||||||
if (cmd->jobContext & IF_FALSE_CONTEXT) {
|
if (cmd->jobContext & IF_FALSE_CONTEXT) {
|
||||||
return TRUE;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
cmd->jobContext |= THEN_EXP_CONTEXT;
|
cmd->jobContext |= THEN_EXP_CONTEXT;
|
||||||
@ -464,11 +464,11 @@ static int builtin_else(struct job *cmd, struct jobSet *junk)
|
|||||||
|
|
||||||
if (! (cmd->jobContext & (IF_TRUE_CONTEXT|IF_FALSE_CONTEXT))) {
|
if (! (cmd->jobContext & (IF_TRUE_CONTEXT|IF_FALSE_CONTEXT))) {
|
||||||
errorMsg("unexpected token `else'\n");
|
errorMsg("unexpected token `else'\n");
|
||||||
return FALSE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
/* If the if result was TRUE, skip the 'else' stuff */
|
/* If the if result was TRUE, skip the 'else' stuff */
|
||||||
if (cmd->jobContext & IF_TRUE_CONTEXT) {
|
if (cmd->jobContext & IF_TRUE_CONTEXT) {
|
||||||
return TRUE;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
cmd->jobContext |= ELSE_EXP_CONTEXT;
|
cmd->jobContext |= ELSE_EXP_CONTEXT;
|
||||||
@ -488,12 +488,12 @@ static int builtin_fi(struct job *cmd, struct jobSet *junk)
|
|||||||
{
|
{
|
||||||
if (! (cmd->jobContext & (IF_TRUE_CONTEXT|IF_FALSE_CONTEXT))) {
|
if (! (cmd->jobContext & (IF_TRUE_CONTEXT|IF_FALSE_CONTEXT))) {
|
||||||
errorMsg("unexpected token `fi'\n");
|
errorMsg("unexpected token `fi'\n");
|
||||||
return FALSE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
/* Clear out the if and then context bits */
|
/* Clear out the if and then context bits */
|
||||||
cmd->jobContext &= ~(IF_TRUE_CONTEXT|IF_FALSE_CONTEXT|THEN_EXP_CONTEXT|ELSE_EXP_CONTEXT);
|
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);
|
debug_printf(stderr, "Hit an fi -- jobContext=%d\n", cmd->jobContext);
|
||||||
return TRUE;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -504,13 +504,13 @@ static int builtin_source(struct job *cmd, struct jobSet *junk)
|
|||||||
int status;
|
int status;
|
||||||
|
|
||||||
if (!cmd->progs[0].argv[1] == 1)
|
if (!cmd->progs[0].argv[1] == 1)
|
||||||
return FALSE;
|
return EXIT_FAILURE;
|
||||||
|
|
||||||
input = fopen(cmd->progs[0].argv[1], "r");
|
input = fopen(cmd->progs[0].argv[1], "r");
|
||||||
if (!input) {
|
if (!input) {
|
||||||
fprintf(stdout, "Couldn't open file '%s'\n",
|
fprintf(stdout, "Couldn't open file '%s'\n",
|
||||||
cmd->progs[0].argv[1]);
|
cmd->progs[0].argv[1]);
|
||||||
return FALSE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Now run the file */
|
/* Now run the file */
|
||||||
@ -524,10 +524,10 @@ static int builtin_unset(struct job *cmd, struct jobSet *junk)
|
|||||||
{
|
{
|
||||||
if (!cmd->progs[0].argv[1] == 1) {
|
if (!cmd->progs[0].argv[1] == 1) {
|
||||||
fprintf(stdout, "unset: parameter required.\n");
|
fprintf(stdout, "unset: parameter required.\n");
|
||||||
return FALSE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
unsetenv(cmd->progs[0].argv[1]);
|
unsetenv(cmd->progs[0].argv[1]);
|
||||||
return TRUE;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* free up all memory from a job */
|
/* free up all memory from a job */
|
||||||
|
2
length.c
2
length.c
@ -9,5 +9,5 @@ extern int length_main(int argc, char **argv)
|
|||||||
if (argc != 2 || **(argv + 1) == '-')
|
if (argc != 2 || **(argv + 1) == '-')
|
||||||
usage(length_usage);
|
usage(length_usage);
|
||||||
printf("%lu\n", (long)strlen(argv[1]));
|
printf("%lu\n", (long)strlen(argv[1]));
|
||||||
return (TRUE);
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
@ -40,17 +40,17 @@ int loadacm_main(int argc, char **argv)
|
|||||||
fd = open("/dev/tty", O_RDWR);
|
fd = open("/dev/tty", O_RDWR);
|
||||||
if (fd < 0) {
|
if (fd < 0) {
|
||||||
errorMsg("Error opening /dev/tty1: %s\n", strerror(errno));
|
errorMsg("Error opening /dev/tty1: %s\n", strerror(errno));
|
||||||
return( FALSE);
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (screen_map_load(fd, stdin)) {
|
if (screen_map_load(fd, stdin)) {
|
||||||
errorMsg("Error loading acm: %s\n", strerror(errno));
|
errorMsg("Error loading acm: %s\n", strerror(errno));
|
||||||
return( FALSE);
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
write(fd, "\033(K", 3);
|
write(fd, "\033(K", 3);
|
||||||
|
|
||||||
return( TRUE);
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
int screen_map_load(int fd, FILE * fp)
|
int screen_map_load(int fd, FILE * fp)
|
||||||
|
1
ls.c
1
ls.c
@ -878,5 +878,4 @@ extern int ls_main(int argc, char **argv)
|
|||||||
|
|
||||||
print_usage_message:
|
print_usage_message:
|
||||||
usage(ls_usage);
|
usage(ls_usage);
|
||||||
return(FALSE);
|
|
||||||
}
|
}
|
||||||
|
19
md5sum.c
19
md5sum.c
@ -902,22 +902,22 @@ int md5sum_main(int argc,
|
|||||||
|
|
||||||
if (file_type_specified && do_check) {
|
if (file_type_specified && do_check) {
|
||||||
errorMsg("the -b and -t options are meaningless when verifying checksums\n");
|
errorMsg("the -b and -t options are meaningless when verifying checksums\n");
|
||||||
exit FALSE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (n_strings > 0 && do_check) {
|
if (n_strings > 0 && do_check) {
|
||||||
errorMsg("the -g and -c options are mutually exclusive\n");
|
errorMsg("the -g and -c options are mutually exclusive\n");
|
||||||
exit FALSE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (status_only && !do_check) {
|
if (status_only && !do_check) {
|
||||||
errorMsg("the -s option is meaningful only when verifying checksums\n");
|
errorMsg("the -s option is meaningful only when verifying checksums\n");
|
||||||
exit FALSE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (warn && !do_check) {
|
if (warn && !do_check) {
|
||||||
errorMsg("the -w option is meaningful only when verifying checksums\n");
|
errorMsg("the -w option is meaningful only when verifying checksums\n");
|
||||||
exit FALSE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (n_strings > 0) {
|
if (n_strings > 0) {
|
||||||
@ -925,7 +925,7 @@ int md5sum_main(int argc,
|
|||||||
|
|
||||||
if (optind < argc) {
|
if (optind < argc) {
|
||||||
errorMsg("no files may be specified when using -g\n");
|
errorMsg("no files may be specified when using -g\n");
|
||||||
exit FALSE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
for (i = 0; i < n_strings; ++i) {
|
for (i = 0; i < n_strings; ++i) {
|
||||||
size_t cnt;
|
size_t cnt;
|
||||||
@ -992,13 +992,16 @@ int md5sum_main(int argc,
|
|||||||
|
|
||||||
if (fclose (stdout) == EOF) {
|
if (fclose (stdout) == EOF) {
|
||||||
errorMsg("write error\n");
|
errorMsg("write error\n");
|
||||||
exit FALSE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (have_read_stdin && fclose (stdin) == EOF) {
|
if (have_read_stdin && fclose (stdin) == EOF) {
|
||||||
errorMsg("standard input\n");
|
errorMsg("standard input\n");
|
||||||
exit FALSE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
exit (err == 0 ? TRUE : FALSE);
|
if (err == 0)
|
||||||
|
return EXIT_SUCCESS;
|
||||||
|
else
|
||||||
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
@ -13,19 +13,15 @@ static unsigned int pointer;
|
|||||||
|
|
||||||
static void push(double a)
|
static void push(double a)
|
||||||
{
|
{
|
||||||
if (pointer >= (sizeof(stack) / sizeof(*stack))) {
|
if (pointer >= (sizeof(stack) / sizeof(*stack)))
|
||||||
errorMsg("stack overflow\n");
|
fatalError("stack overflow\n");
|
||||||
exit(-1);
|
stack[pointer++] = a;
|
||||||
} else
|
|
||||||
stack[pointer++] = a;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static double pop()
|
static double pop()
|
||||||
{
|
{
|
||||||
if (pointer == 0) {
|
if (pointer == 0)
|
||||||
errorMsg("stack underflow\n");
|
fatalError("stack underflow\n");
|
||||||
exit(-1);
|
|
||||||
}
|
|
||||||
return stack[--pointer];
|
return stack[--pointer];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -124,8 +120,7 @@ static void stack_machine(const char *argument)
|
|||||||
}
|
}
|
||||||
o++;
|
o++;
|
||||||
}
|
}
|
||||||
errorMsg("%s: syntax error.\n", argument);
|
fatalError("%s: syntax error.\n", argument);
|
||||||
exit(-1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* return pointer to next token in buffer and set *buffer to one char
|
/* return pointer to next token in buffer and set *buffer to one char
|
||||||
@ -182,5 +177,5 @@ int dc_main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
stack_machine(0);
|
stack_machine(0);
|
||||||
return( TRUE);
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
@ -62,5 +62,5 @@ extern int dutmp_main(int argc, char **argv)
|
|||||||
ut.ut_addr);
|
ut.ut_addr);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
return(TRUE);
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
@ -31,7 +31,7 @@ extern int mktemp_main(int argc, char **argv)
|
|||||||
if (argc != 2 && (argc != 3 || strcmp(argv[1], "-q")))
|
if (argc != 2 && (argc != 3 || strcmp(argv[1], "-q")))
|
||||||
usage(mktemp_usage);
|
usage(mktemp_usage);
|
||||||
if(mkstemp(argv[argc-1]) < 0)
|
if(mkstemp(argv[argc-1]) < 0)
|
||||||
exit(FALSE);
|
return EXIT_FAILURE;
|
||||||
(void) puts(argv[argc-1]);
|
(void) puts(argv[argc-1]);
|
||||||
return(TRUE);
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
@ -76,7 +76,7 @@ extern int mt_main(int argc, char **argv)
|
|||||||
|
|
||||||
if (code->name == 0) {
|
if (code->name == 0) {
|
||||||
errorMsg("unrecognized opcode %s.\n", argv[1]);
|
errorMsg("unrecognized opcode %s.\n", argv[1]);
|
||||||
exit (FALSE);
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
op.mt_op = code->value;
|
op.mt_op = code->value;
|
||||||
@ -87,13 +87,13 @@ extern int mt_main(int argc, char **argv)
|
|||||||
|
|
||||||
if ((fd = open(file, O_RDONLY, 0)) < 0) {
|
if ((fd = open(file, O_RDONLY, 0)) < 0) {
|
||||||
perror(file);
|
perror(file);
|
||||||
exit (FALSE);
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ioctl(fd, MTIOCTOP, &op) != 0) {
|
if (ioctl(fd, MTIOCTOP, &op) != 0) {
|
||||||
perror(file);
|
perror(file);
|
||||||
exit (FALSE);
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (TRUE);
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
@ -67,7 +67,7 @@ extern int update_main(int argc, char **argv)
|
|||||||
|
|
||||||
pid = fork();
|
pid = fork();
|
||||||
if (pid < 0)
|
if (pid < 0)
|
||||||
exit(FALSE);
|
return EXIT_FAILURE;
|
||||||
else if (pid == 0) {
|
else if (pid == 0) {
|
||||||
/* Become a proper daemon */
|
/* Become a proper daemon */
|
||||||
setsid();
|
setsid();
|
||||||
@ -99,12 +99,12 @@ extern int update_main(int argc, char **argv)
|
|||||||
syslog(LOG_INFO,
|
syslog(LOG_INFO,
|
||||||
"This kernel does not need update(8). Exiting.");
|
"This kernel does not need update(8). Exiting.");
|
||||||
closelog();
|
closelog();
|
||||||
exit(TRUE);
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return( TRUE);
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
10
mkdir.c
10
mkdir.c
@ -51,7 +51,7 @@ extern int mkdir_main(int argc, char **argv)
|
|||||||
mode = 0;
|
mode = 0;
|
||||||
if (parse_mode(*(++argv), &mode) == FALSE) {
|
if (parse_mode(*(++argv), &mode) == FALSE) {
|
||||||
errorMsg("Unknown mode: %s\n", *argv);
|
errorMsg("Unknown mode: %s\n", *argv);
|
||||||
exit FALSE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
/* Set the umask for this process so it doesn't
|
/* Set the umask for this process so it doesn't
|
||||||
* screw up whatever the user just entered. */
|
* screw up whatever the user just entered. */
|
||||||
@ -80,13 +80,13 @@ extern int mkdir_main(int argc, char **argv)
|
|||||||
|
|
||||||
if (strlen(*argv) > BUFSIZ - 1) {
|
if (strlen(*argv) > BUFSIZ - 1) {
|
||||||
errorMsg(name_too_long);
|
errorMsg(name_too_long);
|
||||||
exit FALSE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
strcpy(buf, *argv);
|
strcpy(buf, *argv);
|
||||||
status = stat(buf, &statBuf);
|
status = stat(buf, &statBuf);
|
||||||
if (parentFlag == FALSE && status != -1 && errno != ENOENT) {
|
if (parentFlag == FALSE && status != -1 && errno != ENOENT) {
|
||||||
errorMsg("%s: File exists\n", buf);
|
errorMsg("%s: File exists\n", buf);
|
||||||
exit FALSE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
if (parentFlag == TRUE) {
|
if (parentFlag == TRUE) {
|
||||||
strcat(buf, "/");
|
strcat(buf, "/");
|
||||||
@ -94,11 +94,11 @@ extern int mkdir_main(int argc, char **argv)
|
|||||||
} else {
|
} else {
|
||||||
if (mkdir(buf, mode) != 0 && parentFlag == FALSE) {
|
if (mkdir(buf, mode) != 0 && parentFlag == FALSE) {
|
||||||
perror(buf);
|
perror(buf);
|
||||||
exit FALSE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
argc--;
|
argc--;
|
||||||
argv++;
|
argv++;
|
||||||
}
|
}
|
||||||
return( TRUE);
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
4
mkfifo.c
4
mkfifo.c
@ -55,7 +55,7 @@ extern int mkfifo_main(int argc, char **argv)
|
|||||||
usage(mkfifo_usage);
|
usage(mkfifo_usage);
|
||||||
if (mkfifo(*argv, mode) < 0) {
|
if (mkfifo(*argv, mode) < 0) {
|
||||||
perror("mkfifo");
|
perror("mkfifo");
|
||||||
exit(255);
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
return(TRUE);
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
2
mknod.c
2
mknod.c
@ -85,6 +85,6 @@ int mknod_main(int argc, char **argv)
|
|||||||
|
|
||||||
if (mknod(argv[0], mode, dev) != 0)
|
if (mknod(argv[0], mode, dev) != 0)
|
||||||
fatalError("%s: %s\n", argv[0], strerror(errno));
|
fatalError("%s: %s\n", argv[0], strerror(errno));
|
||||||
return (TRUE);
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
10
mkswap.c
10
mkswap.c
@ -176,7 +176,7 @@ static int bit_test_and_clear(unsigned int *addr, unsigned int nr)
|
|||||||
void die(const char *str)
|
void die(const char *str)
|
||||||
{
|
{
|
||||||
errorMsg("%s\n", str);
|
errorMsg("%s\n", str);
|
||||||
exit(FALSE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
void page_ok(int page)
|
void page_ok(int page)
|
||||||
@ -325,7 +325,7 @@ int mkswap_main(int argc, char **argv)
|
|||||||
} else if (PAGES > sz && !force) {
|
} else if (PAGES > sz && !force) {
|
||||||
errorMsg("error: size %ld is larger than device size %d\n",
|
errorMsg("error: size %ld is larger than device size %d\n",
|
||||||
PAGES * (pagesize / 1024), sz * (pagesize / 1024));
|
PAGES * (pagesize / 1024), sz * (pagesize / 1024));
|
||||||
exit(FALSE);
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (version == -1) {
|
if (version == -1) {
|
||||||
@ -369,7 +369,7 @@ int mkswap_main(int argc, char **argv)
|
|||||||
DEV = open(device_name, O_RDWR);
|
DEV = open(device_name, O_RDWR);
|
||||||
if (DEV < 0 || fstat(DEV, &statbuf) < 0) {
|
if (DEV < 0 || fstat(DEV, &statbuf) < 0) {
|
||||||
perror(device_name);
|
perror(device_name);
|
||||||
exit(FALSE);
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
if (!S_ISBLK(statbuf.st_mode))
|
if (!S_ISBLK(statbuf.st_mode))
|
||||||
check = 0;
|
check = 0;
|
||||||
@ -393,7 +393,7 @@ int mkswap_main(int argc, char **argv)
|
|||||||
"This probably means creating v0 swap would destroy your partition table\n"
|
"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"
|
"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);
|
"the -f option to force it.\n", device_name);
|
||||||
exit(FALSE);
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -429,5 +429,5 @@ int mkswap_main(int argc, char **argv)
|
|||||||
*/
|
*/
|
||||||
if (fsync(DEV))
|
if (fsync(DEV))
|
||||||
die("fsync failed");
|
die("fsync failed");
|
||||||
return(TRUE);
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
4
mktemp.c
4
mktemp.c
@ -31,7 +31,7 @@ extern int mktemp_main(int argc, char **argv)
|
|||||||
if (argc != 2 && (argc != 3 || strcmp(argv[1], "-q")))
|
if (argc != 2 && (argc != 3 || strcmp(argv[1], "-q")))
|
||||||
usage(mktemp_usage);
|
usage(mktemp_usage);
|
||||||
if(mkstemp(argv[argc-1]) < 0)
|
if(mkstemp(argv[argc-1]) < 0)
|
||||||
exit(FALSE);
|
return EXIT_FAILURE;
|
||||||
(void) puts(argv[argc-1]);
|
(void) puts(argv[argc-1]);
|
||||||
return(TRUE);
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
@ -77,7 +77,7 @@
|
|||||||
#ifndef MODUTILS_MODULE_H
|
#ifndef MODUTILS_MODULE_H
|
||||||
#define MODUTILS_MODULE_H 1
|
#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.
|
/* 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
|
We do not use the kernel headers directly because we do not wish
|
||||||
@ -283,7 +283,7 @@ int delete_module(const char *);
|
|||||||
#ifndef MODUTILS_OBJ_H
|
#ifndef MODUTILS_OBJ_H
|
||||||
#define MODUTILS_OBJ_H 1
|
#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. */
|
/* The relocatable object is manipulated using elfin types. */
|
||||||
|
|
||||||
@ -2769,7 +2769,7 @@ extern int insmod_main( int argc, char **argv)
|
|||||||
FILE *fp;
|
FILE *fp;
|
||||||
struct obj_file *f;
|
struct obj_file *f;
|
||||||
char m_name[BUFSIZ + 1] = "\0";
|
char m_name[BUFSIZ + 1] = "\0";
|
||||||
int exit_status = FALSE;
|
int exit_status = EXIT_FAILURE;
|
||||||
int m_has_modinfo;
|
int m_has_modinfo;
|
||||||
#ifdef BB_FEATURE_INSMOD_VERSION_CHECKING
|
#ifdef BB_FEATURE_INSMOD_VERSION_CHECKING
|
||||||
int k_version;
|
int k_version;
|
||||||
@ -2833,7 +2833,7 @@ extern int insmod_main( int argc, char **argv)
|
|||||||
|| ((fp = fopen(m_filename, "r")) == NULL))
|
|| ((fp = fopen(m_filename, "r")) == NULL))
|
||||||
{
|
{
|
||||||
errorMsg("No module named '%s' found in '%s'\n", m_fullName, _PATH_MODULES);
|
errorMsg("No module named '%s' found in '%s'\n", m_fullName, _PATH_MODULES);
|
||||||
exit(FALSE);
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
fatalError("No module named '%s' found in '%s'\n", m_fullName, _PATH_MODULES);
|
fatalError("No module named '%s' found in '%s'\n", m_fullName, _PATH_MODULES);
|
||||||
@ -2843,7 +2843,7 @@ extern int insmod_main( int argc, char **argv)
|
|||||||
|
|
||||||
if ((f = obj_load(fp)) == NULL) {
|
if ((f = obj_load(fp)) == NULL) {
|
||||||
perror("Could not load the module\n");
|
perror("Could not load the module\n");
|
||||||
exit(FALSE);
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (get_modinfo_value(f, "kernel_version") == NULL)
|
if (get_modinfo_value(f, "kernel_version") == NULL)
|
||||||
@ -2981,7 +2981,7 @@ extern int insmod_main( int argc, char **argv)
|
|||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
exit_status = TRUE;
|
exit_status = EXIT_SUCCESS;
|
||||||
|
|
||||||
out:
|
out:
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
|
@ -34,7 +34,7 @@ _syscall1(int, delete_module, const char *, name)
|
|||||||
|
|
||||||
extern int rmmod_main(int argc, char **argv)
|
extern int rmmod_main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
int ret = TRUE;
|
int ret = EXIT_SUCCESS;
|
||||||
if (argc <= 1) {
|
if (argc <= 1) {
|
||||||
usage(rmmod_usage);
|
usage(rmmod_usage);
|
||||||
}
|
}
|
||||||
@ -47,9 +47,9 @@ extern int rmmod_main(int argc, char **argv)
|
|||||||
/* Unload _all_ unused modules via NULL delete_module() call */
|
/* Unload _all_ unused modules via NULL delete_module() call */
|
||||||
if (delete_module(NULL)) {
|
if (delete_module(NULL)) {
|
||||||
perror("rmmod");
|
perror("rmmod");
|
||||||
exit(FALSE);
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
exit(TRUE);
|
return EXIT_SUCCESS;
|
||||||
default:
|
default:
|
||||||
usage(rmmod_usage);
|
usage(rmmod_usage);
|
||||||
}
|
}
|
||||||
@ -59,7 +59,7 @@ extern int rmmod_main(int argc, char **argv)
|
|||||||
while (argc-- > 0) {
|
while (argc-- > 0) {
|
||||||
if (delete_module(*argv) < 0) {
|
if (delete_module(*argv) < 0) {
|
||||||
perror(*argv);
|
perror(*argv);
|
||||||
ret=FALSE;
|
ret = EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
argv++;
|
argv++;
|
||||||
}
|
}
|
||||||
|
12
mount.c
12
mount.c
@ -330,7 +330,7 @@ extern int mount_main(int argc, char **argv)
|
|||||||
int fakeIt = FALSE;
|
int fakeIt = FALSE;
|
||||||
int useMtab = TRUE;
|
int useMtab = TRUE;
|
||||||
int i;
|
int i;
|
||||||
int rc = FALSE;
|
int rc = EXIT_FAILURE;
|
||||||
int fstabmount = FALSE;
|
int fstabmount = FALSE;
|
||||||
|
|
||||||
#if defined BB_FEATURE_USE_DEVPS_PATCH
|
#if defined BB_FEATURE_USE_DEVPS_PATCH
|
||||||
@ -367,7 +367,7 @@ extern int mount_main(int argc, char **argv)
|
|||||||
free( mntentlist);
|
free( mntentlist);
|
||||||
close(fd);
|
close(fd);
|
||||||
#endif
|
#endif
|
||||||
exit(TRUE);
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
if (argc == 1) {
|
if (argc == 1) {
|
||||||
@ -388,7 +388,7 @@ extern int mount_main(int argc, char **argv)
|
|||||||
} else {
|
} else {
|
||||||
perror(mtab_file);
|
perror(mtab_file);
|
||||||
}
|
}
|
||||||
exit(TRUE);
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -489,7 +489,7 @@ singlemount:
|
|||||||
&extra_opts, &string_flags, 1);
|
&extra_opts, &string_flags, 1);
|
||||||
if ( rc != 0) {
|
if ( rc != 0) {
|
||||||
fatalError("nfsmount failed: %s\n", strerror(errno));
|
fatalError("nfsmount failed: %s\n", strerror(errno));
|
||||||
rc = FALSE;
|
rc = EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -499,7 +499,7 @@ singlemount:
|
|||||||
if (all == FALSE)
|
if (all == FALSE)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
rc = TRUE; // Always return 0 for 'all'
|
rc = EXIT_SUCCESS; // Always return 0 for 'all'
|
||||||
}
|
}
|
||||||
if (fstabmount == TRUE)
|
if (fstabmount == TRUE)
|
||||||
endmntent(f);
|
endmntent(f);
|
||||||
@ -512,8 +512,6 @@ singlemount:
|
|||||||
|
|
||||||
goto singlemount;
|
goto singlemount;
|
||||||
|
|
||||||
exit(FALSE);
|
|
||||||
|
|
||||||
goodbye:
|
goodbye:
|
||||||
usage(mount_usage);
|
usage(mount_usage);
|
||||||
}
|
}
|
||||||
|
8
mt.c
8
mt.c
@ -76,7 +76,7 @@ extern int mt_main(int argc, char **argv)
|
|||||||
|
|
||||||
if (code->name == 0) {
|
if (code->name == 0) {
|
||||||
errorMsg("unrecognized opcode %s.\n", argv[1]);
|
errorMsg("unrecognized opcode %s.\n", argv[1]);
|
||||||
exit (FALSE);
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
op.mt_op = code->value;
|
op.mt_op = code->value;
|
||||||
@ -87,13 +87,13 @@ extern int mt_main(int argc, char **argv)
|
|||||||
|
|
||||||
if ((fd = open(file, O_RDONLY, 0)) < 0) {
|
if ((fd = open(file, O_RDONLY, 0)) < 0) {
|
||||||
perror(file);
|
perror(file);
|
||||||
exit (FALSE);
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ioctl(fd, MTIOCTOP, &op) != 0) {
|
if (ioctl(fd, MTIOCTOP, &op) != 0) {
|
||||||
perror(file);
|
perror(file);
|
||||||
exit (FALSE);
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (TRUE);
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
@ -167,7 +167,7 @@ int nslookup_main(int argc, char **argv)
|
|||||||
host = gethostbyname(argv[1]);
|
host = gethostbyname(argv[1]);
|
||||||
}
|
}
|
||||||
hostent_fprint(host, stdout);
|
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 $ */
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/* vi: set sw=4 ts=4: */
|
/* 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
|
* Mini ping implementation for busybox
|
||||||
*
|
*
|
||||||
* Copyright (C) 1999 by Randolph Chung <tausq@debian.org>
|
* Copyright (C) 1999 by Randolph Chung <tausq@debian.org>
|
||||||
@ -256,7 +256,7 @@ extern int ping_main(int argc, char **argv)
|
|||||||
if (argc < 1)
|
if (argc < 1)
|
||||||
usage(ping_usage);
|
usage(ping_usage);
|
||||||
ping(*argv);
|
ping(*argv);
|
||||||
exit(TRUE);
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
#else /* ! BB_FEATURE_SIMPLE_PING */
|
#else /* ! BB_FEATURE_SIMPLE_PING */
|
||||||
@ -546,7 +546,7 @@ extern int ping_main(int argc, char **argv)
|
|||||||
|
|
||||||
myid = getpid() & 0xFFFF;
|
myid = getpid() & 0xFFFF;
|
||||||
ping(*argv);
|
ping(*argv);
|
||||||
return(TRUE);
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
#endif /* ! BB_FEATURE_SIMPLE_PING */
|
#endif /* ! BB_FEATURE_SIMPLE_PING */
|
||||||
|
|
||||||
|
@ -167,7 +167,7 @@ int nslookup_main(int argc, char **argv)
|
|||||||
host = gethostbyname(argv[1]);
|
host = gethostbyname(argv[1]);
|
||||||
}
|
}
|
||||||
hostent_fprint(host, stdout);
|
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 $ */
|
||||||
|
6
ping.c
6
ping.c
@ -1,6 +1,6 @@
|
|||||||
/* vi: set sw=4 ts=4: */
|
/* 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
|
* Mini ping implementation for busybox
|
||||||
*
|
*
|
||||||
* Copyright (C) 1999 by Randolph Chung <tausq@debian.org>
|
* Copyright (C) 1999 by Randolph Chung <tausq@debian.org>
|
||||||
@ -256,7 +256,7 @@ extern int ping_main(int argc, char **argv)
|
|||||||
if (argc < 1)
|
if (argc < 1)
|
||||||
usage(ping_usage);
|
usage(ping_usage);
|
||||||
ping(*argv);
|
ping(*argv);
|
||||||
exit(TRUE);
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
#else /* ! BB_FEATURE_SIMPLE_PING */
|
#else /* ! BB_FEATURE_SIMPLE_PING */
|
||||||
@ -546,7 +546,7 @@ extern int ping_main(int argc, char **argv)
|
|||||||
|
|
||||||
myid = getpid() & 0xFFFF;
|
myid = getpid() & 0xFFFF;
|
||||||
ping(*argv);
|
ping(*argv);
|
||||||
return(TRUE);
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
#endif /* ! BB_FEATURE_SIMPLE_PING */
|
#endif /* ! BB_FEATURE_SIMPLE_PING */
|
||||||
|
|
||||||
|
@ -60,7 +60,7 @@ extern int free_main(int argc, char **argv)
|
|||||||
printf("%6s%13ld%13ld%13ld\n", "Total:", info.totalram+info.totalswap,
|
printf("%6s%13ld%13ld%13ld\n", "Total:", info.totalram+info.totalswap,
|
||||||
(info.totalram-info.freeram)+(info.totalswap-info.freeswap),
|
(info.totalram-info.freeram)+(info.totalswap-info.freeswap),
|
||||||
info.freeram+info.freeswap);
|
info.freeram+info.freeswap);
|
||||||
return(TRUE);
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -158,7 +158,7 @@ extern int kill_main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
fprintf(stderr, "\n\n");
|
fprintf(stderr, "\n\n");
|
||||||
exit(TRUE);
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case '-':
|
case '-':
|
||||||
@ -236,11 +236,12 @@ extern int kill_main(int argc, char **argv)
|
|||||||
* upon exit, so we can save a byte or two */
|
* upon exit, so we can save a byte or two */
|
||||||
argv++;
|
argv++;
|
||||||
}
|
}
|
||||||
exit (all_found);
|
if (all_found == FALSE)
|
||||||
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
exit(TRUE);
|
return EXIT_SUCCESS;
|
||||||
|
|
||||||
|
|
||||||
end:
|
end:
|
||||||
|
@ -183,7 +183,7 @@ extern int ps_main(int argc, char **argv)
|
|||||||
fprintf(stdout, "\n");
|
fprintf(stdout, "\n");
|
||||||
}
|
}
|
||||||
closedir(dir);
|
closedir(dir);
|
||||||
return(TRUE);
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -70,5 +70,5 @@ extern int uptime_main(int argc, char **argv)
|
|||||||
LOAD_INT(info.loads[1]), LOAD_FRAC(info.loads[1]),
|
LOAD_INT(info.loads[1]), LOAD_FRAC(info.loads[1]),
|
||||||
LOAD_INT(info.loads[2]), LOAD_FRAC(info.loads[2]));
|
LOAD_INT(info.loads[2]), LOAD_FRAC(info.loads[2]));
|
||||||
|
|
||||||
return(TRUE);
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
2
ps.c
2
ps.c
@ -183,7 +183,7 @@ extern int ps_main(int argc, char **argv)
|
|||||||
fprintf(stdout, "\n");
|
fprintf(stdout, "\n");
|
||||||
}
|
}
|
||||||
closedir(dir);
|
closedir(dir);
|
||||||
return(TRUE);
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
2
pwd.c
2
pwd.c
@ -34,5 +34,5 @@ extern int pwd_main(int argc, char **argv)
|
|||||||
fatalError("%s\n", strerror(errno));
|
fatalError("%s\n", strerror(errno));
|
||||||
|
|
||||||
printf("%s\n", buf);
|
printf("%s\n", buf);
|
||||||
return(TRUE);
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user