aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlandley <landley@69ca8d6d-28ef-0310-b511-8ec308f3f277>2006-06-19 03:20:03 +0000
committerlandley <landley@69ca8d6d-28ef-0310-b511-8ec308f3f277>2006-06-19 03:20:03 +0000
commitf81bb8593ab45e072547369c13935460e1ebe753 (patch)
treef98b6d5bf4c3d48dd54db386c29d39ab26e1463e
parentca40cc4d80863b7520492467135ff185b8322459 (diff)
downloadbusybox-w32-f81bb8593ab45e072547369c13935460e1ebe753.tar.gz
busybox-w32-f81bb8593ab45e072547369c13935460e1ebe753.tar.bz2
busybox-w32-f81bb8593ab45e072547369c13935460e1ebe753.zip
Make some 64 bit warnings go away on x86-64.
git-svn-id: svn://busybox.net/trunk/busybox@15429 69ca8d6d-28ef-0310-b511-8ec308f3f277
-rw-r--r--coreutils/who.c15
-rw-r--r--e2fsprogs/e2fsck.c41
-rw-r--r--networking/ping6.c4
-rw-r--r--shell/lash.c12
-rw-r--r--util-linux/nfsmount.c12
-rw-r--r--util-linux/nfsmount.h2
6 files changed, 25 insertions, 61 deletions
diff --git a/coreutils/who.c b/coreutils/who.c
index 0cb74313e..5cff65157 100644
--- a/coreutils/who.c
+++ b/coreutils/who.c
@@ -14,12 +14,9 @@
14 *---------------------------------------------------------------------- 14 *----------------------------------------------------------------------
15 */ 15 */
16 16
17#include <stdio.h> 17#include "busybox.h"
18#include <stdlib.h>
19#include <utmp.h> 18#include <utmp.h>
20#include <sys/stat.h>
21#include <time.h> 19#include <time.h>
22#include "busybox.h"
23 20
24static const char * idle_string (time_t t) 21static const char * idle_string (time_t t)
25{ 22{
@@ -33,7 +30,7 @@ static const char * idle_string (time_t t)
33 sprintf (str, "%02d:%02d", 30 sprintf (str, "%02d:%02d",
34 (int) (s / (60 * 60)), 31 (int) (s / (60 * 60)),
35 (int) ((s % (60 * 60)) / 60)); 32 (int) ((s % (60 * 60)) / 60));
36 return (const char *) str; 33 return str;
37 } 34 }
38 return "old"; 35 return "old";
39} 36}
@@ -52,14 +49,16 @@ int who_main(int argc, char **argv)
52 printf("USER TTY IDLE TIME HOST\n"); 49 printf("USER TTY IDLE TIME HOST\n");
53 while ((ut = getutent()) != NULL) { 50 while ((ut = getutent()) != NULL) {
54 if (ut->ut_user[0] && ut->ut_type == USER_PROCESS) { 51 if (ut->ut_user[0] && ut->ut_type == USER_PROCESS) {
52 time_t thyme = ut->ut_tv.tv_sec;
53
55 /* ut->ut_line is device name of tty - "/dev/" */ 54 /* ut->ut_line is device name of tty - "/dev/" */
56 name = concat_path_file("/dev", ut->ut_line); 55 name = concat_path_file("/dev", ut->ut_line);
57 printf("%-10s %-8s %-8s %-12.12s %s\n", ut->ut_user, ut->ut_line, 56 printf("%-10s %-8s %-8s %-12.12s %s\n", ut->ut_user, ut->ut_line,
58 (stat(name, &st)) ? "?" : idle_string(st.st_atime), 57 (stat(name, &st)) ? "?" : idle_string(st.st_atime),
59 ctime((time_t*)&(ut->ut_tv.tv_sec)) + 4, ut->ut_host); 58 ctime(&thyme) + 4, ut->ut_host);
60 free(name); 59 if (ENABLE_FEATURE_CLEAN_UP) free(name);
61 } 60 }
62 } 61 }
63 endutent(); 62 if (ENABLE_FEATURE_CLEAN_UP) endutent();
64 return 0; 63 return 0;
65} 64}
diff --git a/e2fsprogs/e2fsck.c b/e2fsprogs/e2fsck.c
index ceafaea4b..0d151ef80 100644
--- a/e2fsprogs/e2fsck.c
+++ b/e2fsprogs/e2fsck.c
@@ -3,9 +3,6 @@
3 * 3 *
4 * Copyright (C) 1993, 1994, 1995, 1996, 1997 Theodore Ts'o. 4 * Copyright (C) 1993, 1994, 1995, 1996, 1997 Theodore Ts'o.
5 * Copyright (C) 2006 Garrett Kajmowicz 5 * Copyright (C) 2006 Garrett Kajmowicz
6 * This file may be
7 * redistributed under the terms of the GNU Public License.
8 *
9 * 6 *
10 * Dictionary Abstract Data Type 7 * Dictionary Abstract Data Type
11 * Copyright (C) 1997 Kaz Kylheku <kaz@ashi.footprints.net> 8 * Copyright (C) 1997 Kaz Kylheku <kaz@ashi.footprints.net>
@@ -25,12 +22,10 @@
25 * 22 *
26 * Copyright 1999-2000 Red Hat Software --- All Rights Reserved 23 * Copyright 1999-2000 Red Hat Software --- All Rights Reserved
27 * 24 *
28 * This file is part of the Linux kernel and is made available under
29 * the terms of the GNU General Public License, version 2, or at your
30 * option, any later version, incorporated herein by reference.
31 *
32 * Journal recovery routines for the generic filesystem journaling code; 25 * Journal recovery routines for the generic filesystem journaling code;
33 * part of the ext2fs journaling system. 26 * part of the ext2fs journaling system.
27 *
28 * Licensed under GPLv2 or later, see file License in this tarball for details.
34 */ 29 */
35 30
36#ifndef _GNU_SOURCE 31#ifndef _GNU_SOURCE
@@ -2532,16 +2527,8 @@ static void expand_inode_expression(char ch,
2532 if (LINUX_S_ISDIR(inode->i_mode)) 2527 if (LINUX_S_ISDIR(inode->i_mode))
2533 printf("%u", inode->i_size); 2528 printf("%u", inode->i_size);
2534 else { 2529 else {
2535#ifdef EXT2_NO_64_TYPE 2530 printf("%"PRIu64, (inode->i_size |
2536 if (inode->i_size_high) 2531 ((uint64_t) inode->i_size_high << 32)));
2537 printf("0x%x%08x", inode->i_size_high,
2538 inode->i_size);
2539 else
2540 printf("%u", inode->i_size);
2541#else
2542 printf("%llu", (inode->i_size |
2543 ((__u64) inode->i_size_high << 32)));
2544#endif
2545 } 2532 }
2546 break; 2533 break;
2547 case 'S': 2534 case 'S':
@@ -2649,11 +2636,7 @@ static void expand_percent_expression(ext2_filsys fs, char ch,
2649 printf("%u", ctx->blk); 2636 printf("%u", ctx->blk);
2650 break; 2637 break;
2651 case 'B': 2638 case 'B':
2652#ifdef EXT2_NO_64_TYPE 2639 printf("%"PRIi64, ctx->blkcount);
2653 printf("%d", ctx->blkcount);
2654#else
2655 printf("%lld", ctx->blkcount);
2656#endif
2657 break; 2640 break;
2658 case 'c': 2641 case 'c':
2659 printf("%u", ctx->blk2); 2642 printf("%u", ctx->blk2);
@@ -2674,11 +2657,7 @@ static void expand_percent_expression(ext2_filsys fs, char ch,
2674 printf("%s", error_message(ctx->errcode)); 2657 printf("%s", error_message(ctx->errcode));
2675 break; 2658 break;
2676 case 'N': 2659 case 'N':
2677#ifdef EXT2_NO_64_TYPE 2660 printf("%"PRIi64, ctx->num);
2678 printf("%u", ctx->num);
2679#else
2680 printf("%llu", ctx->num);
2681#endif
2682 break; 2661 break;
2683 case 'p': 2662 case 'p':
2684 print_pathname(fs, ctx->ino, 0); 2663 print_pathname(fs, ctx->ino, 0);
@@ -2700,11 +2679,7 @@ static void expand_percent_expression(ext2_filsys fs, char ch,
2700 printf("%s", ctx->str ? ctx->str : "NULL"); 2679 printf("%s", ctx->str ? ctx->str : "NULL");
2701 break; 2680 break;
2702 case 'X': 2681 case 'X':
2703#ifdef EXT2_NO_64_TYPE 2682 printf("0x%"PRIi64, ctx->num);
2704 printf("0x%x", ctx->num);
2705#else
2706 printf("0x%llx", ctx->num);
2707#endif
2708 break; 2683 break;
2709 default: 2684 default:
2710 no_context: 2685 no_context:
@@ -4436,7 +4411,7 @@ static int process_bad_block(ext2_filsys fs FSCK_ATTR((unused)),
4436 * inode, which is never compressed. So we don't use HOLE_BLKADDR(). 4411 * inode, which is never compressed. So we don't use HOLE_BLKADDR().
4437 */ 4412 */
4438 4413
4439 printf("Unrecoverable Error: Found %lli bad blocks starting at block number: %u\n", blockcnt, *block_nr); 4414 printf("Unrecoverable Error: Found %"PRIi64" bad blocks starting at block number: %u\n", blockcnt, *block_nr);
4440 return BLOCK_ERROR; 4415 return BLOCK_ERROR;
4441} 4416}
4442 4417
diff --git a/networking/ping6.c b/networking/ping6.c
index 1cff59d4b..c15ea5c4a 100644
--- a/networking/ping6.c
+++ b/networking/ping6.c
@@ -311,7 +311,7 @@ static void unpack(char *packet, int sz, struct sockaddr_in6 *from, int hoplimit
311 return; 311 return;
312 312
313 printf("%d bytes from %s: icmp6_seq=%u", sz, 313 printf("%d bytes from %s: icmp6_seq=%u", sz,
314 inet_ntop(AF_INET6, (struct in_addr6 *) &pingaddr.sin6_addr, 314 inet_ntop(AF_INET6, &pingaddr.sin6_addr,
315 buf, sizeof(buf)), 315 buf, sizeof(buf)),
316 icmppkt->icmp6_seq); 316 icmppkt->icmp6_seq);
317 printf(" ttl=%d time=%lu.%lu ms", hoplimit, 317 printf(" ttl=%d time=%lu.%lu ms", hoplimit,
@@ -392,7 +392,7 @@ static void ping(const char *host)
392 392
393 printf("PING %s (%s): %d data bytes\n", 393 printf("PING %s (%s): %d data bytes\n",
394 hostent->h_name, 394 hostent->h_name,
395 inet_ntop(AF_INET6, (struct in_addr6 *) &pingaddr.sin6_addr, 395 inet_ntop(AF_INET6, &pingaddr.sin6_addr,
396 buf, sizeof(buf)), 396 buf, sizeof(buf)),
397 datalen); 397 datalen);
398 398
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...*/
diff --git a/util-linux/nfsmount.c b/util-linux/nfsmount.c
index d46cf698a..705975d29 100644
--- a/util-linux/nfsmount.c
+++ b/util-linux/nfsmount.c
@@ -3,15 +3,7 @@
3 * nfsmount.c -- Linux NFS mount 3 * nfsmount.c -- Linux NFS mount
4 * Copyright (C) 1993 Rick Sladkey <jrs@world.std.com> 4 * Copyright (C) 1993 Rick Sladkey <jrs@world.std.com>
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2, or (at your option)
9 * any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 * 7 *
16 * Wed Feb 8 12:51:48 1995, biro@yggdrasil.com (Ross Biro): allow all port 8 * Wed Feb 8 12:51:48 1995, biro@yggdrasil.com (Ross Biro): allow all port
17 * numbers to be specified on the command line. 9 * numbers to be specified on the command line.
@@ -965,7 +957,7 @@ xdr_mountres3_ok (XDR *xdrs, mountres3_ok *objp)
965{ 957{
966 if (!xdr_fhandle3 (xdrs, &objp->fhandle)) 958 if (!xdr_fhandle3 (xdrs, &objp->fhandle))
967 return FALSE; 959 return FALSE;
968 if (!xdr_array (xdrs, (char **)&objp->auth_flavours.auth_flavours_val, (unsigned int *) &objp->auth_flavours.auth_flavours_len, ~0, 960 if (!xdr_array (xdrs, &(objp->auth_flavours.auth_flavours_val), &(objp->auth_flavours.auth_flavours_len), ~0,
969 sizeof (int), (xdrproc_t) xdr_int)) 961 sizeof (int), (xdrproc_t) xdr_int))
970 return FALSE; 962 return FALSE;
971 return TRUE; 963 return TRUE;
diff --git a/util-linux/nfsmount.h b/util-linux/nfsmount.h
index 78a1bdfc5..60e2019b4 100644
--- a/util-linux/nfsmount.h
+++ b/util-linux/nfsmount.h
@@ -91,7 +91,7 @@ struct mountres3_ok {
91 fhandle3 fhandle; 91 fhandle3 fhandle;
92 struct { 92 struct {
93 unsigned int auth_flavours_len; 93 unsigned int auth_flavours_len;
94 int *auth_flavours_val; 94 char *auth_flavours_val;
95 } auth_flavours; 95 } auth_flavours;
96}; 96};
97typedef struct mountres3_ok mountres3_ok; 97typedef struct mountres3_ok mountres3_ok;