aboutsummaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2006-06-19 03:20:03 +0000
committerRob Landley <rob@landley.net>2006-06-19 03:20:03 +0000
commit7a260f01ce6841658810dc9f0ff0706558a10d7f (patch)
treef98b6d5bf4c3d48dd54db386c29d39ab26e1463e /shell
parent290fcb4213ae5ab9ec6cb228dd64ef2c9f02d26d (diff)
downloadbusybox-w32-7a260f01ce6841658810dc9f0ff0706558a10d7f.tar.gz
busybox-w32-7a260f01ce6841658810dc9f0ff0706558a10d7f.tar.bz2
busybox-w32-7a260f01ce6841658810dc9f0ff0706558a10d7f.zip
Make some 64 bit warnings go away on x86-64.
Diffstat (limited to 'shell')
-rw-r--r--shell/lash.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/shell/lash.c b/shell/lash.c
index eebb2f8a2..27eb8ec29 100644
--- a/shell/lash.c
+++ b/shell/lash.c
@@ -243,7 +243,7 @@ static int builtin_exec(struct child_prog *child)
243 if (child->argv[1] == NULL) 243 if (child->argv[1] == NULL)
244 return EXIT_SUCCESS; /* Really? */ 244 return EXIT_SUCCESS; /* Really? */
245 child->argv++; 245 child->argv++;
246 while(close_me_list) close((int)llist_pop(&close_me_list)); 246 while(close_me_list) close((long)llist_pop(&close_me_list));
247 pseudo_exec(child); 247 pseudo_exec(child);
248 /* never returns */ 248 /* never returns */
249} 249}
@@ -433,7 +433,6 @@ static int builtin_source(struct child_prog *child)
433{ 433{
434 FILE *input; 434 FILE *input;
435 int status; 435 int status;
436 int fd;
437 436
438 if (child->argv[1] == NULL) 437 if (child->argv[1] == NULL)
439 return EXIT_FAILURE; 438 return EXIT_FAILURE;
@@ -444,8 +443,7 @@ static int builtin_source(struct child_prog *child)
444 return EXIT_FAILURE; 443 return EXIT_FAILURE;
445 } 444 }
446 445
447 fd=fileno(input); 446 llist_add_to(&close_me_list, (void *)(long)fileno(input));
448 llist_add_to(&close_me_list, (void *)fd);
449 /* Now run the file */ 447 /* Now run the file */
450 status = busy_loop(input); 448 status = busy_loop(input);
451 fclose(input); 449 fclose(input);
@@ -1339,7 +1337,7 @@ static int run_command(struct job *newjob, int inbg, int outpipe[2])
1339 signal(SIGCHLD, SIG_DFL); 1337 signal(SIGCHLD, SIG_DFL);
1340 1338
1341 // Close all open filehandles. 1339 // Close all open filehandles.
1342 while(close_me_list) close((int)llist_pop(&close_me_list)); 1340 while(close_me_list) close((long)llist_pop(&close_me_list));
1343 1341
1344 if (outpipe[1]!=-1) { 1342 if (outpipe[1]!=-1) {
1345 close(outpipe[0]); 1343 close(outpipe[0]);
@@ -1570,7 +1568,7 @@ int lash_main(int argc_l, char **argv_l)
1570 FILE *prof_input; 1568 FILE *prof_input;
1571 prof_input = fopen("/etc/profile", "r"); 1569 prof_input = fopen("/etc/profile", "r");
1572 if (prof_input) { 1570 if (prof_input) {
1573 llist_add_to(&close_me_list, (void *)fileno(prof_input)); 1571 llist_add_to(&close_me_list, (void *)(long)fileno(prof_input));
1574 /* Now run the file */ 1572 /* Now run the file */
1575 busy_loop(prof_input); 1573 busy_loop(prof_input);
1576 fclose(prof_input); 1574 fclose(prof_input);
@@ -1618,7 +1616,7 @@ int lash_main(int argc_l, char **argv_l)
1618 //printf( "optind=%d argv[optind]='%s'\n", optind, argv[optind]); 1616 //printf( "optind=%d argv[optind]='%s'\n", optind, argv[optind]);
1619 input = bb_xfopen(argv[optind], "r"); 1617 input = bb_xfopen(argv[optind], "r");
1620 /* be lazy, never mark this closed */ 1618 /* be lazy, never mark this closed */
1621 llist_add_to(&close_me_list, (void *)fileno(input)); 1619 llist_add_to(&close_me_list, (void *)(long)fileno(input));
1622 } 1620 }
1623 1621
1624 /* initialize the cwd -- this is never freed...*/ 1622 /* initialize the cwd -- this is never freed...*/