*----------------------------------------------------------------------
*/
-#include <stdio.h>
-#include <stdlib.h>
+#include "busybox.h"
#include <utmp.h>
-#include <sys/stat.h>
#include <time.h>
-#include "busybox.h"
static const char * idle_string (time_t t)
{
sprintf (str, "%02d:%02d",
(int) (s / (60 * 60)),
(int) ((s % (60 * 60)) / 60));
- return (const char *) str;
+ return str;
}
return "old";
}
printf("USER TTY IDLE TIME HOST\n");
while ((ut = getutent()) != NULL) {
if (ut->ut_user[0] && ut->ut_type == USER_PROCESS) {
+ time_t thyme = ut->ut_tv.tv_sec;
+
/* ut->ut_line is device name of tty - "/dev/" */
name = concat_path_file("/dev", ut->ut_line);
printf("%-10s %-8s %-8s %-12.12s %s\n", ut->ut_user, ut->ut_line,
(stat(name, &st)) ? "?" : idle_string(st.st_atime),
- ctime((time_t*)&(ut->ut_tv.tv_sec)) + 4, ut->ut_host);
- free(name);
+ ctime(&thyme) + 4, ut->ut_host);
+ if (ENABLE_FEATURE_CLEAN_UP) free(name);
}
}
- endutent();
+ if (ENABLE_FEATURE_CLEAN_UP) endutent();
return 0;
}
*
* Copyright (C) 1993, 1994, 1995, 1996, 1997 Theodore Ts'o.
* Copyright (C) 2006 Garrett Kajmowicz
- * This file may be
- * redistributed under the terms of the GNU Public License.
- *
*
* Dictionary Abstract Data Type
* Copyright (C) 1997 Kaz Kylheku <kaz@ashi.footprints.net>
*
* Copyright 1999-2000 Red Hat Software --- All Rights Reserved
*
- * This file is part of the Linux kernel and is made available under
- * the terms of the GNU General Public License, version 2, or at your
- * option, any later version, incorporated herein by reference.
- *
* Journal recovery routines for the generic filesystem journaling code;
* part of the ext2fs journaling system.
+ *
+ * Licensed under GPLv2 or later, see file License in this tarball for details.
*/
#ifndef _GNU_SOURCE
if (LINUX_S_ISDIR(inode->i_mode))
printf("%u", inode->i_size);
else {
-#ifdef EXT2_NO_64_TYPE
- if (inode->i_size_high)
- printf("0x%x%08x", inode->i_size_high,
- inode->i_size);
- else
- printf("%u", inode->i_size);
-#else
- printf("%llu", (inode->i_size |
- ((__u64) inode->i_size_high << 32)));
-#endif
+ printf("%"PRIu64, (inode->i_size |
+ ((uint64_t) inode->i_size_high << 32)));
}
break;
case 'S':
printf("%u", ctx->blk);
break;
case 'B':
-#ifdef EXT2_NO_64_TYPE
- printf("%d", ctx->blkcount);
-#else
- printf("%lld", ctx->blkcount);
-#endif
+ printf("%"PRIi64, ctx->blkcount);
break;
case 'c':
printf("%u", ctx->blk2);
printf("%s", error_message(ctx->errcode));
break;
case 'N':
-#ifdef EXT2_NO_64_TYPE
- printf("%u", ctx->num);
-#else
- printf("%llu", ctx->num);
-#endif
+ printf("%"PRIi64, ctx->num);
break;
case 'p':
print_pathname(fs, ctx->ino, 0);
printf("%s", ctx->str ? ctx->str : "NULL");
break;
case 'X':
-#ifdef EXT2_NO_64_TYPE
- printf("0x%x", ctx->num);
-#else
- printf("0x%llx", ctx->num);
-#endif
+ printf("0x%"PRIi64, ctx->num);
break;
default:
no_context:
* inode, which is never compressed. So we don't use HOLE_BLKADDR().
*/
- printf("Unrecoverable Error: Found %lli bad blocks starting at block number: %u\n", blockcnt, *block_nr);
+ printf("Unrecoverable Error: Found %"PRIi64" bad blocks starting at block number: %u\n", blockcnt, *block_nr);
return BLOCK_ERROR;
}
return;
printf("%d bytes from %s: icmp6_seq=%u", sz,
- inet_ntop(AF_INET6, (struct in_addr6 *) &pingaddr.sin6_addr,
+ inet_ntop(AF_INET6, &pingaddr.sin6_addr,
buf, sizeof(buf)),
icmppkt->icmp6_seq);
printf(" ttl=%d time=%lu.%lu ms", hoplimit,
printf("PING %s (%s): %d data bytes\n",
hostent->h_name,
- inet_ntop(AF_INET6, (struct in_addr6 *) &pingaddr.sin6_addr,
+ inet_ntop(AF_INET6, &pingaddr.sin6_addr,
buf, sizeof(buf)),
datalen);
if (child->argv[1] == NULL)
return EXIT_SUCCESS; /* Really? */
child->argv++;
- while(close_me_list) close((int)llist_pop(&close_me_list));
+ while(close_me_list) close((long)llist_pop(&close_me_list));
pseudo_exec(child);
/* never returns */
}
{
FILE *input;
int status;
- int fd;
if (child->argv[1] == NULL)
return EXIT_FAILURE;
return EXIT_FAILURE;
}
- fd=fileno(input);
- llist_add_to(&close_me_list, (void *)fd);
+ llist_add_to(&close_me_list, (void *)(long)fileno(input));
/* Now run the file */
status = busy_loop(input);
fclose(input);
signal(SIGCHLD, SIG_DFL);
// Close all open filehandles.
- while(close_me_list) close((int)llist_pop(&close_me_list));
+ while(close_me_list) close((long)llist_pop(&close_me_list));
if (outpipe[1]!=-1) {
close(outpipe[0]);
FILE *prof_input;
prof_input = fopen("/etc/profile", "r");
if (prof_input) {
- llist_add_to(&close_me_list, (void *)fileno(prof_input));
+ llist_add_to(&close_me_list, (void *)(long)fileno(prof_input));
/* Now run the file */
busy_loop(prof_input);
fclose(prof_input);
//printf( "optind=%d argv[optind]='%s'\n", optind, argv[optind]);
input = bb_xfopen(argv[optind], "r");
/* be lazy, never mark this closed */
- llist_add_to(&close_me_list, (void *)fileno(input));
+ llist_add_to(&close_me_list, (void *)(long)fileno(input));
}
/* initialize the cwd -- this is never freed...*/
* nfsmount.c -- Linux NFS mount
* Copyright (C) 1993 Rick Sladkey <jrs@world.std.com>
*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
*
* Wed Feb 8 12:51:48 1995, biro@yggdrasil.com (Ross Biro): allow all port
* numbers to be specified on the command line.
{
if (!xdr_fhandle3 (xdrs, &objp->fhandle))
return FALSE;
- if (!xdr_array (xdrs, (char **)&objp->auth_flavours.auth_flavours_val, (unsigned int *) &objp->auth_flavours.auth_flavours_len, ~0,
+ if (!xdr_array (xdrs, &(objp->auth_flavours.auth_flavours_val), &(objp->auth_flavours.auth_flavours_len), ~0,
sizeof (int), (xdrproc_t) xdr_int))
return FALSE;
return TRUE;
fhandle3 fhandle;
struct {
unsigned int auth_flavours_len;
- int *auth_flavours_val;
+ char *auth_flavours_val;
} auth_flavours;
};
typedef struct mountres3_ok mountres3_ok;