More printf cleanups
This commit is contained in:
parent
1d269432b1
commit
6f65a3a7e8
18
lash.c
18
lash.c
@ -290,7 +290,7 @@ static int builtin_env(struct child_prog *dummy)
|
|||||||
char **e;
|
char **e;
|
||||||
|
|
||||||
for (e = environ; *e; e++) {
|
for (e = environ; *e; e++) {
|
||||||
fprintf(stdout, "%s\n", *e);
|
printf( "%s\n", *e);
|
||||||
}
|
}
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
@ -406,7 +406,7 @@ static int builtin_jobs(struct child_prog *child)
|
|||||||
static int builtin_pwd(struct child_prog *dummy)
|
static int builtin_pwd(struct child_prog *dummy)
|
||||||
{
|
{
|
||||||
getcwd(cwd, MAX_LINE);
|
getcwd(cwd, MAX_LINE);
|
||||||
fprintf(stdout, "%s\n", cwd);
|
printf( "%s\n", cwd);
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -566,7 +566,7 @@ static int builtin_source(struct child_prog *child)
|
|||||||
|
|
||||||
input = fopen(child->argv[1], "r");
|
input = fopen(child->argv[1], "r");
|
||||||
if (!input) {
|
if (!input) {
|
||||||
fprintf(stdout, "Couldn't open file '%s'\n", child->argv[1]);
|
printf( "Couldn't open file '%s'\n", child->argv[1]);
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -583,7 +583,7 @@ static int builtin_source(struct child_prog *child)
|
|||||||
static int builtin_unset(struct child_prog *child)
|
static int builtin_unset(struct child_prog *child)
|
||||||
{
|
{
|
||||||
if (child->argv[1] == NULL) {
|
if (child->argv[1] == NULL) {
|
||||||
fprintf(stdout, "unset: parameter required.\n");
|
printf( "unset: parameter required.\n");
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
unsetenv(child->argv[1]);
|
unsetenv(child->argv[1]);
|
||||||
@ -1704,7 +1704,7 @@ int shell_main(int argc_l, char **argv_l)
|
|||||||
FILE *prof_input;
|
FILE *prof_input;
|
||||||
prof_input = fopen("/etc/profile", "r");
|
prof_input = fopen("/etc/profile", "r");
|
||||||
if (!prof_input) {
|
if (!prof_input) {
|
||||||
fprintf(stdout, "Couldn't open file '/etc/profile'\n");
|
printf( "Couldn't open file '/etc/profile'\n");
|
||||||
} else {
|
} else {
|
||||||
int tmp_fd = fileno(prof_input);
|
int tmp_fd = fileno(prof_input);
|
||||||
mark_open(tmp_fd);
|
mark_open(tmp_fd);
|
||||||
@ -1749,12 +1749,12 @@ int shell_main(int argc_l, char **argv_l)
|
|||||||
interactive=TRUE;
|
interactive=TRUE;
|
||||||
}
|
}
|
||||||
if (interactive==TRUE) {
|
if (interactive==TRUE) {
|
||||||
//fprintf(stdout, "optind=%d argv[optind]='%s'\n", optind, argv[optind]);
|
//printf( "optind=%d argv[optind]='%s'\n", optind, argv[optind]);
|
||||||
/* Looks like they want an interactive shell */
|
/* Looks like they want an interactive shell */
|
||||||
fprintf(stdout, "\n\nBusyBox v%s (%s) Built-in shell (lash)\n", BB_VER, BB_BT);
|
printf( "\n\nBusyBox v%s (%s) Built-in shell (lash)\n", BB_VER, BB_BT);
|
||||||
fprintf(stdout, "Enter 'help' for a list of built-in commands.\n\n");
|
printf( "Enter 'help' for a list of built-in commands.\n\n");
|
||||||
} else if (local_pending_command==NULL) {
|
} else if (local_pending_command==NULL) {
|
||||||
//fprintf(stdout, "optind=%d argv[optind]='%s'\n", optind, argv[optind]);
|
//printf( "optind=%d argv[optind]='%s'\n", optind, argv[optind]);
|
||||||
input = xfopen(argv[optind], "r");
|
input = xfopen(argv[optind], "r");
|
||||||
mark_open(fileno(input)); /* be lazy, never mark this closed */
|
mark_open(fileno(input)); /* be lazy, never mark this closed */
|
||||||
}
|
}
|
||||||
|
2
mount.c
2
mount.c
@ -353,7 +353,7 @@ extern int mount_main(int argc, char **argv)
|
|||||||
perror_msg_and_die( "\nDEVMTAB_GET_MOUNTS");
|
perror_msg_and_die( "\nDEVMTAB_GET_MOUNTS");
|
||||||
|
|
||||||
for( i = 0 ; i < numfilesystems ; i++) {
|
for( i = 0 ; i < numfilesystems ; i++) {
|
||||||
fprintf( stdout, "%s %s %s %s %d %d\n", mntentlist[i].mnt_fsname,
|
printf( "%s %s %s %s %d %d\n", mntentlist[i].mnt_fsname,
|
||||||
mntentlist[i].mnt_dir, mntentlist[i].mnt_type,
|
mntentlist[i].mnt_dir, mntentlist[i].mnt_type,
|
||||||
mntentlist[i].mnt_opts, mntentlist[i].mnt_freq,
|
mntentlist[i].mnt_opts, mntentlist[i].mnt_freq,
|
||||||
mntentlist[i].mnt_passno);
|
mntentlist[i].mnt_passno);
|
||||||
|
18
sh.c
18
sh.c
@ -290,7 +290,7 @@ static int builtin_env(struct child_prog *dummy)
|
|||||||
char **e;
|
char **e;
|
||||||
|
|
||||||
for (e = environ; *e; e++) {
|
for (e = environ; *e; e++) {
|
||||||
fprintf(stdout, "%s\n", *e);
|
printf( "%s\n", *e);
|
||||||
}
|
}
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
@ -406,7 +406,7 @@ static int builtin_jobs(struct child_prog *child)
|
|||||||
static int builtin_pwd(struct child_prog *dummy)
|
static int builtin_pwd(struct child_prog *dummy)
|
||||||
{
|
{
|
||||||
getcwd(cwd, MAX_LINE);
|
getcwd(cwd, MAX_LINE);
|
||||||
fprintf(stdout, "%s\n", cwd);
|
printf( "%s\n", cwd);
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -566,7 +566,7 @@ static int builtin_source(struct child_prog *child)
|
|||||||
|
|
||||||
input = fopen(child->argv[1], "r");
|
input = fopen(child->argv[1], "r");
|
||||||
if (!input) {
|
if (!input) {
|
||||||
fprintf(stdout, "Couldn't open file '%s'\n", child->argv[1]);
|
printf( "Couldn't open file '%s'\n", child->argv[1]);
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -583,7 +583,7 @@ static int builtin_source(struct child_prog *child)
|
|||||||
static int builtin_unset(struct child_prog *child)
|
static int builtin_unset(struct child_prog *child)
|
||||||
{
|
{
|
||||||
if (child->argv[1] == NULL) {
|
if (child->argv[1] == NULL) {
|
||||||
fprintf(stdout, "unset: parameter required.\n");
|
printf( "unset: parameter required.\n");
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
unsetenv(child->argv[1]);
|
unsetenv(child->argv[1]);
|
||||||
@ -1704,7 +1704,7 @@ int shell_main(int argc_l, char **argv_l)
|
|||||||
FILE *prof_input;
|
FILE *prof_input;
|
||||||
prof_input = fopen("/etc/profile", "r");
|
prof_input = fopen("/etc/profile", "r");
|
||||||
if (!prof_input) {
|
if (!prof_input) {
|
||||||
fprintf(stdout, "Couldn't open file '/etc/profile'\n");
|
printf( "Couldn't open file '/etc/profile'\n");
|
||||||
} else {
|
} else {
|
||||||
int tmp_fd = fileno(prof_input);
|
int tmp_fd = fileno(prof_input);
|
||||||
mark_open(tmp_fd);
|
mark_open(tmp_fd);
|
||||||
@ -1749,12 +1749,12 @@ int shell_main(int argc_l, char **argv_l)
|
|||||||
interactive=TRUE;
|
interactive=TRUE;
|
||||||
}
|
}
|
||||||
if (interactive==TRUE) {
|
if (interactive==TRUE) {
|
||||||
//fprintf(stdout, "optind=%d argv[optind]='%s'\n", optind, argv[optind]);
|
//printf( "optind=%d argv[optind]='%s'\n", optind, argv[optind]);
|
||||||
/* Looks like they want an interactive shell */
|
/* Looks like they want an interactive shell */
|
||||||
fprintf(stdout, "\n\nBusyBox v%s (%s) Built-in shell (lash)\n", BB_VER, BB_BT);
|
printf( "\n\nBusyBox v%s (%s) Built-in shell (lash)\n", BB_VER, BB_BT);
|
||||||
fprintf(stdout, "Enter 'help' for a list of built-in commands.\n\n");
|
printf( "Enter 'help' for a list of built-in commands.\n\n");
|
||||||
} else if (local_pending_command==NULL) {
|
} else if (local_pending_command==NULL) {
|
||||||
//fprintf(stdout, "optind=%d argv[optind]='%s'\n", optind, argv[optind]);
|
//printf( "optind=%d argv[optind]='%s'\n", optind, argv[optind]);
|
||||||
input = xfopen(argv[optind], "r");
|
input = xfopen(argv[optind], "r");
|
||||||
mark_open(fileno(input)); /* be lazy, never mark this closed */
|
mark_open(fileno(input)); /* be lazy, never mark this closed */
|
||||||
}
|
}
|
||||||
|
18
shell/lash.c
18
shell/lash.c
@ -290,7 +290,7 @@ static int builtin_env(struct child_prog *dummy)
|
|||||||
char **e;
|
char **e;
|
||||||
|
|
||||||
for (e = environ; *e; e++) {
|
for (e = environ; *e; e++) {
|
||||||
fprintf(stdout, "%s\n", *e);
|
printf( "%s\n", *e);
|
||||||
}
|
}
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
@ -406,7 +406,7 @@ static int builtin_jobs(struct child_prog *child)
|
|||||||
static int builtin_pwd(struct child_prog *dummy)
|
static int builtin_pwd(struct child_prog *dummy)
|
||||||
{
|
{
|
||||||
getcwd(cwd, MAX_LINE);
|
getcwd(cwd, MAX_LINE);
|
||||||
fprintf(stdout, "%s\n", cwd);
|
printf( "%s\n", cwd);
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -566,7 +566,7 @@ static int builtin_source(struct child_prog *child)
|
|||||||
|
|
||||||
input = fopen(child->argv[1], "r");
|
input = fopen(child->argv[1], "r");
|
||||||
if (!input) {
|
if (!input) {
|
||||||
fprintf(stdout, "Couldn't open file '%s'\n", child->argv[1]);
|
printf( "Couldn't open file '%s'\n", child->argv[1]);
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -583,7 +583,7 @@ static int builtin_source(struct child_prog *child)
|
|||||||
static int builtin_unset(struct child_prog *child)
|
static int builtin_unset(struct child_prog *child)
|
||||||
{
|
{
|
||||||
if (child->argv[1] == NULL) {
|
if (child->argv[1] == NULL) {
|
||||||
fprintf(stdout, "unset: parameter required.\n");
|
printf( "unset: parameter required.\n");
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
unsetenv(child->argv[1]);
|
unsetenv(child->argv[1]);
|
||||||
@ -1704,7 +1704,7 @@ int shell_main(int argc_l, char **argv_l)
|
|||||||
FILE *prof_input;
|
FILE *prof_input;
|
||||||
prof_input = fopen("/etc/profile", "r");
|
prof_input = fopen("/etc/profile", "r");
|
||||||
if (!prof_input) {
|
if (!prof_input) {
|
||||||
fprintf(stdout, "Couldn't open file '/etc/profile'\n");
|
printf( "Couldn't open file '/etc/profile'\n");
|
||||||
} else {
|
} else {
|
||||||
int tmp_fd = fileno(prof_input);
|
int tmp_fd = fileno(prof_input);
|
||||||
mark_open(tmp_fd);
|
mark_open(tmp_fd);
|
||||||
@ -1749,12 +1749,12 @@ int shell_main(int argc_l, char **argv_l)
|
|||||||
interactive=TRUE;
|
interactive=TRUE;
|
||||||
}
|
}
|
||||||
if (interactive==TRUE) {
|
if (interactive==TRUE) {
|
||||||
//fprintf(stdout, "optind=%d argv[optind]='%s'\n", optind, argv[optind]);
|
//printf( "optind=%d argv[optind]='%s'\n", optind, argv[optind]);
|
||||||
/* Looks like they want an interactive shell */
|
/* Looks like they want an interactive shell */
|
||||||
fprintf(stdout, "\n\nBusyBox v%s (%s) Built-in shell (lash)\n", BB_VER, BB_BT);
|
printf( "\n\nBusyBox v%s (%s) Built-in shell (lash)\n", BB_VER, BB_BT);
|
||||||
fprintf(stdout, "Enter 'help' for a list of built-in commands.\n\n");
|
printf( "Enter 'help' for a list of built-in commands.\n\n");
|
||||||
} else if (local_pending_command==NULL) {
|
} else if (local_pending_command==NULL) {
|
||||||
//fprintf(stdout, "optind=%d argv[optind]='%s'\n", optind, argv[optind]);
|
//printf( "optind=%d argv[optind]='%s'\n", optind, argv[optind]);
|
||||||
input = xfopen(argv[optind], "r");
|
input = xfopen(argv[optind], "r");
|
||||||
mark_open(fileno(input)); /* be lazy, never mark this closed */
|
mark_open(fileno(input)); /* be lazy, never mark this closed */
|
||||||
}
|
}
|
||||||
|
@ -353,7 +353,7 @@ extern int mount_main(int argc, char **argv)
|
|||||||
perror_msg_and_die( "\nDEVMTAB_GET_MOUNTS");
|
perror_msg_and_die( "\nDEVMTAB_GET_MOUNTS");
|
||||||
|
|
||||||
for( i = 0 ; i < numfilesystems ; i++) {
|
for( i = 0 ; i < numfilesystems ; i++) {
|
||||||
fprintf( stdout, "%s %s %s %s %d %d\n", mntentlist[i].mnt_fsname,
|
printf( "%s %s %s %s %d %d\n", mntentlist[i].mnt_fsname,
|
||||||
mntentlist[i].mnt_dir, mntentlist[i].mnt_type,
|
mntentlist[i].mnt_dir, mntentlist[i].mnt_type,
|
||||||
mntentlist[i].mnt_opts, mntentlist[i].mnt_freq,
|
mntentlist[i].mnt_opts, mntentlist[i].mnt_freq,
|
||||||
mntentlist[i].mnt_passno);
|
mntentlist[i].mnt_passno);
|
||||||
|
Loading…
Reference in New Issue
Block a user