just whitespace
This commit is contained in:
parent
f64ff682a3
commit
c1ef7bdd8d
@ -850,7 +850,7 @@ static void write_status_file(deb_file_t **deb_file)
|
||||
}
|
||||
|
||||
tmp_string += 8;
|
||||
tmp_string += strspn(tmp_string, " \n\t");
|
||||
tmp_string += strspn(tmp_string, " \n\t");
|
||||
package_name = bb_xstrndup(tmp_string, strcspn(tmp_string, "\n\0"));
|
||||
write_flag = FALSE;
|
||||
tmp_string = strstr(control_buffer, "Status:");
|
||||
@ -989,8 +989,8 @@ static int package_satisfies_dependency(int package, int depend_type)
|
||||
return 0;
|
||||
|
||||
switch (depend_type) {
|
||||
case EDGE_PRE_DEPENDS: return get_status(status_num, 3) == search_name_hashtable("installed");
|
||||
case EDGE_DEPENDS: return get_status(status_num, 1) == search_name_hashtable("install");
|
||||
case EDGE_PRE_DEPENDS: return get_status(status_num, 3) == search_name_hashtable("installed");
|
||||
case EDGE_DEPENDS: return get_status(status_num, 1) == search_name_hashtable("install");
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@ -1114,8 +1114,8 @@ static int check_deps(deb_file_t **deb_file, int deb_start, int dep_max_count)
|
||||
* things which are broken but unrelated to the
|
||||
* packages that are currently being installed
|
||||
*/
|
||||
if (state_status == search_name_hashtable("installed"))
|
||||
continue;
|
||||
if (state_status == search_name_hashtable("installed"))
|
||||
continue;
|
||||
#endif
|
||||
|
||||
/* This code is tested only for EDGE_DEPENDS, since I
|
||||
@ -1127,11 +1127,11 @@ static int check_deps(deb_file_t **deb_file, int deb_start, int dep_max_count)
|
||||
unsigned int package_num;
|
||||
|
||||
if ( package_edge->type == EDGE_OR_PRE_DEPENDS ||
|
||||
package_edge->type == EDGE_OR_DEPENDS ) { /* start an EDGE_OR_ list */
|
||||
package_edge->type == EDGE_OR_DEPENDS ) { /* start an EDGE_OR_ list */
|
||||
number_of_alternatives = package_edge->version;
|
||||
root_of_alternatives = package_edge;
|
||||
continue;
|
||||
} else if ( number_of_alternatives == 0 ) { /* not in the middle of an EDGE_OR_ list */
|
||||
} else if ( number_of_alternatives == 0 ) { /* not in the middle of an EDGE_OR_ list */
|
||||
number_of_alternatives = 1;
|
||||
root_of_alternatives = NULL;
|
||||
}
|
||||
@ -1329,7 +1329,7 @@ static void free_array(char **array)
|
||||
*/
|
||||
static void list_packages(void)
|
||||
{
|
||||
int i;
|
||||
int i;
|
||||
|
||||
printf(" Name Version\n");
|
||||
printf("+++-==============-==============\n");
|
||||
@ -1715,7 +1715,7 @@ int dpkg_main(int argc, char **argv)
|
||||
|
||||
if (package_num == -1) {
|
||||
bb_error_msg("Invalid control file in %s", argv[optind]);
|
||||
optind++;
|
||||
optind++;
|
||||
continue;
|
||||
}
|
||||
deb_file[deb_count]->package = (unsigned int) package_num;
|
||||
|
@ -1031,7 +1031,7 @@ static void fill_window(void)
|
||||
*/
|
||||
#define FLUSH_BLOCK(eof) \
|
||||
flush_block(block_start >= 0L ? (char*)&window[(unsigned)block_start] : \
|
||||
(char*)NULL, (long)strstart - block_start, (eof))
|
||||
(char*)NULL, (long)strstart - block_start, (eof))
|
||||
|
||||
/* ===========================================================================
|
||||
* Same as above, but achieves better compression. We use a lazy
|
||||
|
@ -51,9 +51,9 @@
|
||||
|
||||
/* Constants for Huffman coding */
|
||||
#define MAX_GROUPS 6
|
||||
#define GROUP_SIZE 50 /* 64 would have been more efficient */
|
||||
#define MAX_HUFCODE_BITS 20 /* Longest Huffman code allowed */
|
||||
#define MAX_SYMBOLS 258 /* 256 literals + RUNA + RUNB */
|
||||
#define GROUP_SIZE 50 /* 64 would have been more efficient */
|
||||
#define MAX_HUFCODE_BITS 20 /* Longest Huffman code allowed */
|
||||
#define MAX_SYMBOLS 258 /* 256 literals + RUNA + RUNB */
|
||||
#define SYMBOL_RUNA 0
|
||||
#define SYMBOL_RUNB 1
|
||||
|
||||
|
@ -50,9 +50,9 @@ typedef struct {
|
||||
#define LZMA_LEN_CHOICE_2 (LZMA_LEN_CHOICE + 1)
|
||||
#define LZMA_LEN_LOW (LZMA_LEN_CHOICE_2 + 1)
|
||||
#define LZMA_LEN_MID (LZMA_LEN_LOW \
|
||||
+ (1 << (LZMA_NUM_POS_BITS_MAX + LZMA_LEN_NUM_LOW_BITS)))
|
||||
+ (1 << (LZMA_NUM_POS_BITS_MAX + LZMA_LEN_NUM_LOW_BITS)))
|
||||
#define LZMA_LEN_HIGH (LZMA_LEN_MID \
|
||||
+(1 << (LZMA_NUM_POS_BITS_MAX + LZMA_LEN_NUM_MID_BITS)))
|
||||
+(1 << (LZMA_NUM_POS_BITS_MAX + LZMA_LEN_NUM_MID_BITS)))
|
||||
#define LZMA_NUM_LEN_PROBS (LZMA_LEN_HIGH + (1 << LZMA_LEN_NUM_HIGH_BITS))
|
||||
|
||||
#define LZMA_NUM_STATES 12
|
||||
@ -76,11 +76,11 @@ typedef struct {
|
||||
#define LZMA_IS_REP_G2 (LZMA_IS_REP_G1 + LZMA_NUM_STATES)
|
||||
#define LZMA_IS_REP_0_LONG (LZMA_IS_REP_G2 + LZMA_NUM_STATES)
|
||||
#define LZMA_POS_SLOT (LZMA_IS_REP_0_LONG \
|
||||
+ (LZMA_NUM_STATES << LZMA_NUM_POS_BITS_MAX))
|
||||
+ (LZMA_NUM_STATES << LZMA_NUM_POS_BITS_MAX))
|
||||
#define LZMA_SPEC_POS (LZMA_POS_SLOT \
|
||||
+(LZMA_NUM_LEN_TO_POS_STATES << LZMA_NUM_POS_SLOT_BITS))
|
||||
+(LZMA_NUM_LEN_TO_POS_STATES << LZMA_NUM_POS_SLOT_BITS))
|
||||
#define LZMA_ALIGN (LZMA_SPEC_POS \
|
||||
+ LZMA_NUM_FULL_DISTANCES - LZMA_END_POS_MODEL_INDEX)
|
||||
+ LZMA_NUM_FULL_DISTANCES - LZMA_END_POS_MODEL_INDEX)
|
||||
#define LZMA_LEN_CODER (LZMA_ALIGN + (1 << LZMA_NUM_ALIGN_BITS))
|
||||
#define LZMA_REP_LEN_CODER (LZMA_LEN_CODER + LZMA_NUM_LEN_PROBS)
|
||||
#define LZMA_LITERAL (LZMA_REP_LEN_CODER + LZMA_NUM_LEN_PROBS)
|
||||
|
@ -26,15 +26,15 @@ extern char get_header_ar(archive_handle_t *archive_handle)
|
||||
file_header_t *typed = archive_handle->file_header;
|
||||
union {
|
||||
char raw[60];
|
||||
struct {
|
||||
char name[16];
|
||||
char date[12];
|
||||
char uid[6];
|
||||
char gid[6];
|
||||
char mode[8];
|
||||
char size[10];
|
||||
char magic[2];
|
||||
} formated;
|
||||
struct {
|
||||
char name[16];
|
||||
char date[12];
|
||||
char uid[6];
|
||||
char gid[6];
|
||||
char mode[8];
|
||||
char size[10];
|
||||
char magic[2];
|
||||
} formated;
|
||||
} ar;
|
||||
#ifdef CONFIG_FEATURE_AR_LONG_FILENAMES
|
||||
static char *ar_long_names;
|
||||
@ -102,7 +102,7 @@ extern char get_header_ar(archive_handle_t *archive_handle)
|
||||
#endif
|
||||
} else {
|
||||
/* short filenames */
|
||||
typed->name = bb_xstrndup(ar.formated.name, 16);
|
||||
typed->name = bb_xstrndup(ar.formated.name, 16);
|
||||
}
|
||||
|
||||
typed->name[strcspn(typed->name, " /")] = '\0';
|
||||
|
@ -20,7 +20,7 @@
|
||||
* References:
|
||||
* GNU tar and star man pages,
|
||||
* Opengroup's ustar interchange format,
|
||||
* http://www.opengroup.org/onlinepubs/007904975/utilities/pax.html
|
||||
* http://www.opengroup.org/onlinepubs/007904975/utilities/pax.html
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
|
@ -43,7 +43,7 @@
|
||||
#define RPM_STRING_ARRAY_TYPE 8
|
||||
#define RPM_I18NSTRING_TYPE 9
|
||||
|
||||
#define RPMTAG_NAME 1000
|
||||
#define RPMTAG_NAME 1000
|
||||
#define RPMTAG_VERSION 1001
|
||||
#define RPMTAG_RELEASE 1002
|
||||
#define RPMTAG_SUMMARY 1004
|
||||
|
@ -91,7 +91,7 @@ struct HardLinkInfo {
|
||||
struct TarBallInfo {
|
||||
char *fileName; /* File name of the tarball */
|
||||
int tarFd; /* Open-for-write file descriptor
|
||||
for the tarball */
|
||||
for the tarball */
|
||||
struct stat statBuf; /* Stat info for the tarball, letting
|
||||
us know the inode and device that the
|
||||
tarball lives, so we can avoid trying
|
||||
@ -569,7 +569,7 @@ static char get_header_tar_Z(archive_handle_t *archive_handle)
|
||||
|
||||
/* do the decompression, and cleanup */
|
||||
if (bb_xread_char(archive_handle->src_fd) != 0x1f ||
|
||||
bb_xread_char(archive_handle->src_fd) != 0x9d)
|
||||
bb_xread_char(archive_handle->src_fd) != 0x9d)
|
||||
{
|
||||
bb_error_msg_and_die("Invalid magic");
|
||||
}
|
||||
@ -699,7 +699,7 @@ static const struct option tar_long_options[] = {
|
||||
# ifdef CONFIG_FEATURE_TAR_COMPRESS
|
||||
{ "compress", 0, NULL, 'Z' },
|
||||
# endif
|
||||
{ 0, 0, 0, 0 }
|
||||
{ 0, 0, 0, 0 }
|
||||
};
|
||||
#else
|
||||
#define tar_long_options 0
|
||||
@ -843,9 +843,9 @@ int tar_main(int argc, char **argv)
|
||||
int zipMode = 0;
|
||||
|
||||
if (ENABLE_FEATURE_TAR_GZIP && get_header_ptr == get_header_tar_gz)
|
||||
zipMode = 1;
|
||||
zipMode = 1;
|
||||
if (ENABLE_FEATURE_TAR_BZIP2 && get_header_ptr == get_header_tar_bz2)
|
||||
zipMode = 2;
|
||||
zipMode = 2;
|
||||
|
||||
if ((tar_handle->action_header == header_list) ||
|
||||
(tar_handle->action_header == header_verbose_list))
|
||||
|
@ -66,8 +66,8 @@ typedef union {
|
||||
unsigned short method; /* 4-5 */
|
||||
unsigned short modtime; /* 6-7 */
|
||||
unsigned short moddate; /* 8-9 */
|
||||
unsigned int crc32 ATTRIBUTE_PACKED; /* 10-13 */
|
||||
unsigned int cmpsize ATTRIBUTE_PACKED; /* 14-17 */
|
||||
unsigned int crc32 ATTRIBUTE_PACKED; /* 10-13 */
|
||||
unsigned int cmpsize ATTRIBUTE_PACKED; /* 14-17 */
|
||||
unsigned int ucmpsize ATTRIBUTE_PACKED; /* 18-21 */
|
||||
unsigned short filename_len; /* 22-23 */
|
||||
unsigned short extra_len; /* 24-25 */
|
||||
|
@ -39,7 +39,7 @@ int openvt_main(int argc, char **argv)
|
||||
|
||||
|
||||
if (argc < 3)
|
||||
bb_show_usage();
|
||||
bb_show_usage();
|
||||
|
||||
/* check for Illegal vt number: < 1 or > 12 */
|
||||
sprintf(vtname, VC_FORMAT,(int)bb_xgetlarg(argv[1], 10, 1, 12));
|
||||
|
@ -45,10 +45,10 @@
|
||||
#endif
|
||||
|
||||
#define THURSDAY 4 /* for reformation */
|
||||
#define SATURDAY 6 /* 1 Jan 1 was a Saturday */
|
||||
#define SATURDAY 6 /* 1 Jan 1 was a Saturday */
|
||||
|
||||
#define FIRST_MISSING_DAY 639787 /* 3 Sep 1752 */
|
||||
#define NUMBER_MISSING_DAYS 11 /* 11 day correction */
|
||||
#define FIRST_MISSING_DAY 639787 /* 3 Sep 1752 */
|
||||
#define NUMBER_MISSING_DAYS 11 /* 11 day correction */
|
||||
|
||||
#define MAXDAYS 42 /* max slots in a month array */
|
||||
#define SPACE -1 /* used in day array */
|
||||
|
@ -119,9 +119,9 @@ static struct tm *date_conv_ftime(struct tm *tm_time, const char *t_string)
|
||||
}
|
||||
|
||||
#define DATE_OPT_RFC2822 0x01
|
||||
#define DATE_OPT_SET 0x02
|
||||
#define DATE_OPT_UTC 0x04
|
||||
#define DATE_OPT_DATE 0x08
|
||||
#define DATE_OPT_SET 0x02
|
||||
#define DATE_OPT_UTC 0x04
|
||||
#define DATE_OPT_DATE 0x08
|
||||
#define DATE_OPT_REFERENCE 0x10
|
||||
#ifdef CONFIG_FEATURE_DATE_ISOFMT
|
||||
# define DATE_OPT_TIMESPEC 0x20
|
||||
|
@ -365,7 +365,7 @@ static VALUE *eval6 (void)
|
||||
else {
|
||||
v = xmalloc (sizeof(VALUE));
|
||||
v->type = string;
|
||||
v->u.s = bb_xstrndup(l->u.s + i1->u.i - 1, i2->u.i);
|
||||
v->u.s = bb_xstrndup(l->u.s + i1->u.i - 1, i2->u.i);
|
||||
}
|
||||
freev (l);
|
||||
freev (i1);
|
||||
|
@ -44,7 +44,7 @@ static const struct option install_long_options[] = {
|
||||
{ "preserve-timestamps", 0, NULL, 'p' },
|
||||
{ "strip", 0, NULL, 's' },
|
||||
{ "group", 0, NULL, 'g' },
|
||||
{ "mode", 0, NULL, 'm' },
|
||||
{ "mode", 0, NULL, 'm' },
|
||||
{ "owner", 0, NULL, 'o' },
|
||||
{ 0, 0, 0, 0 }
|
||||
};
|
||||
|
@ -173,7 +173,7 @@ static int show_color = 0;
|
||||
static const struct option ls_color_opt[] =
|
||||
{
|
||||
{"color", optional_argument, NULL, 1},
|
||||
{NULL, 0, NULL, 0}
|
||||
{NULL, 0, NULL, 0}
|
||||
};
|
||||
|
||||
#define COLOR(mode) ("\000\043\043\043\042\000\043\043"\
|
||||
@ -895,57 +895,57 @@ static const char ls_options[]="Cadil1gnsxAk" \
|
||||
|
||||
static const unsigned opt_flags[] = {
|
||||
LIST_SHORT | STYLE_COLUMNS, /* C */
|
||||
DISP_HIDDEN | DISP_DOT, /* a */
|
||||
DISP_NOLIST, /* d */
|
||||
LIST_INO, /* i */
|
||||
LIST_LONG | STYLE_LONG, /* l - remember LS_DISP_HR in mask! */
|
||||
LIST_SHORT | STYLE_SINGLE, /* 1 */
|
||||
0, /* g - ingored */
|
||||
LIST_ID_NUMERIC, /* n */
|
||||
LIST_BLOCKS, /* s */
|
||||
DISP_ROWS, /* x */
|
||||
DISP_HIDDEN, /* A */
|
||||
DISP_HIDDEN | DISP_DOT, /* a */
|
||||
DISP_NOLIST, /* d */
|
||||
LIST_INO, /* i */
|
||||
LIST_LONG | STYLE_LONG, /* l - remember LS_DISP_HR in mask! */
|
||||
LIST_SHORT | STYLE_SINGLE, /* 1 */
|
||||
0, /* g - ingored */
|
||||
LIST_ID_NUMERIC, /* n */
|
||||
LIST_BLOCKS, /* s */
|
||||
DISP_ROWS, /* x */
|
||||
DISP_HIDDEN, /* A */
|
||||
#ifdef CONFIG_SELINUX
|
||||
LIST_CONTEXT, /* k */
|
||||
LIST_CONTEXT, /* k */
|
||||
#else
|
||||
0, /* k - ingored */
|
||||
0, /* k - ingored */
|
||||
#endif
|
||||
#ifdef CONFIG_FEATURE_LS_TIMESTAMPS
|
||||
# ifdef CONFIG_FEATURE_LS_SORTFILES
|
||||
TIME_CHANGE | SORT_CTIME, /* c */
|
||||
# else
|
||||
TIME_CHANGE, /* c */
|
||||
TIME_CHANGE, /* c */
|
||||
# endif
|
||||
LIST_FULLTIME, /* e */
|
||||
LIST_FULLTIME, /* e */
|
||||
# ifdef CONFIG_FEATURE_LS_SORTFILES
|
||||
SORT_MTIME, /* t */
|
||||
SORT_MTIME, /* t */
|
||||
# else
|
||||
0, /* t - ignored -- is this correct? */
|
||||
0, /* t - ignored -- is this correct? */
|
||||
# endif
|
||||
# ifdef CONFIG_FEATURE_LS_SORTFILES
|
||||
TIME_ACCESS | SORT_ATIME, /* u */
|
||||
# else
|
||||
TIME_ACCESS, /* u */
|
||||
TIME_ACCESS, /* u */
|
||||
# endif
|
||||
#endif
|
||||
#ifdef CONFIG_FEATURE_LS_SORTFILES
|
||||
SORT_SIZE, /* S */
|
||||
SORT_EXT, /* X */
|
||||
SORT_ORDER_REVERSE, /* r */
|
||||
SORT_VERSION, /* v */
|
||||
SORT_SIZE, /* S */
|
||||
SORT_EXT, /* X */
|
||||
SORT_ORDER_REVERSE, /* r */
|
||||
SORT_VERSION, /* v */
|
||||
#endif
|
||||
#ifdef CONFIG_FEATURE_LS_FILETYPES
|
||||
LIST_FILETYPE | LIST_EXEC, /* F */
|
||||
LIST_FILETYPE, /* p */
|
||||
LIST_FILETYPE, /* p */
|
||||
#endif
|
||||
#ifdef CONFIG_FEATURE_LS_FOLLOWLINKS
|
||||
FOLLOW_LINKS, /* L */
|
||||
FOLLOW_LINKS, /* L */
|
||||
#endif
|
||||
#ifdef CONFIG_FEATURE_LS_RECURSIVE
|
||||
DISP_RECURSIVE, /* R */
|
||||
DISP_RECURSIVE, /* R */
|
||||
#endif
|
||||
#ifdef CONFIG_FEATURE_HUMAN_READABLE
|
||||
LS_DISP_HR, /* h */
|
||||
LS_DISP_HR, /* h */
|
||||
#endif
|
||||
#ifdef CONFIG_SELINUX
|
||||
LIST_MODEBITS|LIST_NLINKS|LIST_CONTEXT|LIST_SIZE|LIST_DATE_TIME, /* K */
|
||||
@ -1068,7 +1068,7 @@ extern int ls_main(int argc, char **argv)
|
||||
(*p == '\0' || (strcmp(p, "none") == 0))) {
|
||||
;
|
||||
} else if (isatty(STDOUT_FILENO)) {
|
||||
show_color = 1;
|
||||
show_color = 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -59,7 +59,7 @@ extern int rmdir_main(int argc, char **argv)
|
||||
/* Path is now just the parent component. Note that dirname
|
||||
* returns "." if there are no parents. We must distinguish
|
||||
* this from the case of the original path starting with '.'.
|
||||
*/
|
||||
*/
|
||||
if (do_dot || (*path != '.') || path[1]) {
|
||||
continue;
|
||||
}
|
||||
|
@ -132,7 +132,7 @@ static char const *human_fstype(long f_type)
|
||||
#ifdef CONFIG_FEATURE_STAT_FORMAT
|
||||
/* print statfs info */
|
||||
static void print_statfs(char *pformat, size_t buf_len, char m,
|
||||
char const *filename, void const *data)
|
||||
char const *filename, void const *data)
|
||||
{
|
||||
struct statfs const *statfsbuf = data;
|
||||
|
||||
@ -191,7 +191,7 @@ static void print_statfs(char *pformat, size_t buf_len, char m,
|
||||
|
||||
/* print stat info */
|
||||
static void print_stat(char *pformat, size_t buf_len, char m,
|
||||
char const *filename, void const *data)
|
||||
char const *filename, void const *data)
|
||||
{
|
||||
#define TYPE_SIGNED(t) (! ((t) 0 < (t) -1))
|
||||
struct stat *statbuf = (struct stat *) data;
|
||||
@ -327,8 +327,8 @@ static void print_stat(char *pformat, size_t buf_len, char m,
|
||||
}
|
||||
|
||||
static void print_it(char const *masterformat, char const *filename,
|
||||
void (*print_func) (char *, size_t, char, char const *, void const *),
|
||||
void const *data)
|
||||
void (*print_func) (char *, size_t, char, char const *, void const *),
|
||||
void const *data)
|
||||
{
|
||||
char *b;
|
||||
|
||||
|
@ -4,14 +4,14 @@
|
||||
*
|
||||
* Copyright (c) by a whole pile of folks:
|
||||
*
|
||||
* test(1); version 7-like -- author Erik Baalbergen
|
||||
* modified by Eric Gisin to be used as built-in.
|
||||
* modified by Arnold Robbins to add SVR3 compatibility
|
||||
* (-x -c -b -p -u -g -k) plus Korn's -L -nt -ot -ef and new -S (socket).
|
||||
* modified by J.T. Conklin for NetBSD.
|
||||
* modified by Herbert Xu to be used as built-in in ash.
|
||||
* modified by Erik Andersen <andersen@codepoet.org> to be used
|
||||
* in busybox.
|
||||
* test(1); version 7-like -- author Erik Baalbergen
|
||||
* modified by Eric Gisin to be used as built-in.
|
||||
* modified by Arnold Robbins to add SVR3 compatibility
|
||||
* (-x -c -b -p -u -g -k) plus Korn's -L -nt -ot -ef and new -S (socket).
|
||||
* modified by J.T. Conklin for NetBSD.
|
||||
* modified by Herbert Xu to be used as built-in in ash.
|
||||
* modified by Erik Andersen <andersen@codepoet.org> to be used
|
||||
* in busybox.
|
||||
*
|
||||
* 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
|
||||
@ -28,7 +28,7 @@
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
* Original copyright notice states:
|
||||
* "This program is in the Public Domain."
|
||||
* "This program is in the Public Domain."
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
|
@ -93,7 +93,7 @@ int uname_main(int argc, char **argv)
|
||||
}
|
||||
|
||||
#if defined(__sparc__) && defined(__linux__)
|
||||
if ((fake_sparc != NULL)
|
||||
if ((fake_sparc != NULL)
|
||||
&& ((fake_sparc[0] == 'y')
|
||||
|| (fake_sparc[0] == 'Y'))) {
|
||||
strcpy(uname_info.name.machine, "sparc");
|
||||
|
@ -56,7 +56,7 @@ static int read_stduu(FILE *src_stream, FILE *dst_stream)
|
||||
bb_error_msg_and_die("Short file");
|
||||
}
|
||||
|
||||
while (length > 0) {
|
||||
while (length > 0) {
|
||||
/* Merge four 6 bit chars to three 8 bit chars */
|
||||
fputc(((line_ptr[0] - 0x20) & 077) << 2 | ((line_ptr[1] - 0x20) & 077) >> 4, dst_stream);
|
||||
line_ptr++;
|
||||
@ -65,14 +65,14 @@ static int read_stduu(FILE *src_stream, FILE *dst_stream)
|
||||
break;
|
||||
}
|
||||
|
||||
fputc(((line_ptr[0] - 0x20) & 077) << 4 | ((line_ptr[1] - 0x20) & 077) >> 2, dst_stream);
|
||||
fputc(((line_ptr[0] - 0x20) & 077) << 4 | ((line_ptr[1] - 0x20) & 077) >> 2, dst_stream);
|
||||
line_ptr++;
|
||||
length--;
|
||||
if (length == 0) {
|
||||
break;
|
||||
}
|
||||
|
||||
fputc(((line_ptr[0] - 0x20) & 077) << 6 | ((line_ptr[1] - 0x20) & 077), dst_stream);
|
||||
fputc(((line_ptr[0] - 0x20) & 077) << 6 | ((line_ptr[1] - 0x20) & 077), dst_stream);
|
||||
line_ptr += 2;
|
||||
length -= 2;
|
||||
}
|
||||
@ -130,10 +130,10 @@ static int read_base64(FILE *src_stream, FILE *dst_stream)
|
||||
/* Merge 6 bit chars to 8 bit */
|
||||
fputc(translated[0] << 2 | translated[1] >> 4, dst_stream);
|
||||
if (count > 2) {
|
||||
fputc(translated[1] << 4 | translated[2] >> 2, dst_stream);
|
||||
fputc(translated[1] << 4 | translated[2] >> 2, dst_stream);
|
||||
}
|
||||
if (count > 3) {
|
||||
fputc(translated[2] << 6 | translated[3], dst_stream);
|
||||
fputc(translated[2] << 6 | translated[3], dst_stream);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -33,49 +33,49 @@ extern int who_main(int argc, char **argv)
|
||||
time_t now, idle;
|
||||
|
||||
if (argc > 1)
|
||||
bb_show_usage();
|
||||
bb_show_usage();
|
||||
|
||||
setutent();
|
||||
devlen = sizeof("/dev/") - 1;
|
||||
printf("USER TTY IDLE FROM HOST\n");
|
||||
|
||||
while ((ut = getutent()) != NULL) {
|
||||
char name[40];
|
||||
char name[40];
|
||||
|
||||
if (ut->ut_user[0] && ut->ut_type == USER_PROCESS) {
|
||||
len = strlen(ut->ut_line);
|
||||
if (ut->ut_line[0] == '/') {
|
||||
strncpy(name, ut->ut_line, len);
|
||||
name[len] = '\0';
|
||||
strcpy(ut->ut_line, ut->ut_line + devlen);
|
||||
} else {
|
||||
strcpy(name, "/dev/");
|
||||
strncpy(name+devlen, ut->ut_line, len);
|
||||
name[devlen+len] = '\0';
|
||||
}
|
||||
if (ut->ut_user[0] && ut->ut_type == USER_PROCESS) {
|
||||
len = strlen(ut->ut_line);
|
||||
if (ut->ut_line[0] == '/') {
|
||||
strncpy(name, ut->ut_line, len);
|
||||
name[len] = '\0';
|
||||
strcpy(ut->ut_line, ut->ut_line + devlen);
|
||||
} else {
|
||||
strcpy(name, "/dev/");
|
||||
strncpy(name+devlen, ut->ut_line, len);
|
||||
name[devlen+len] = '\0';
|
||||
}
|
||||
|
||||
printf("%-10s %-8s ", ut->ut_user, ut->ut_line);
|
||||
printf("%-10s %-8s ", ut->ut_user, ut->ut_line);
|
||||
|
||||
if (stat(name, &st) == 0) {
|
||||
now = time(NULL);
|
||||
idle = now - st.st_atime;
|
||||
if (stat(name, &st) == 0) {
|
||||
now = time(NULL);
|
||||
idle = now - st.st_atime;
|
||||
|
||||
if (idle < 60)
|
||||
printf("00:00m ");
|
||||
else if (idle < (60 * 60))
|
||||
printf("00:%02dm ", (int)(idle / 60));
|
||||
else if (idle < (24 * 60 * 60))
|
||||
printf("%02d:%02dm ", (int)(idle / (60 * 60)),
|
||||
(int)(idle % (60 * 60)) / 60);
|
||||
else if (idle < (24 * 60 * 60 * 365))
|
||||
printf("%03ddays ", (int)(idle / (24 * 60 * 60)));
|
||||
else
|
||||
printf("%02dyears ", (int) (idle / (24 * 60 * 60 * 365)));
|
||||
} else
|
||||
printf("%-8s ", "?");
|
||||
if (idle < 60)
|
||||
printf("00:00m ");
|
||||
else if (idle < (60 * 60))
|
||||
printf("00:%02dm ", (int)(idle / 60));
|
||||
else if (idle < (24 * 60 * 60))
|
||||
printf("%02d:%02dm ", (int)(idle / (60 * 60)),
|
||||
(int)(idle % (60 * 60)) / 60);
|
||||
else if (idle < (24 * 60 * 60 * 365))
|
||||
printf("%03ddays ", (int)(idle / (24 * 60 * 60)));
|
||||
else
|
||||
printf("%02dyears ", (int) (idle / (24 * 60 * 60 * 365)));
|
||||
} else
|
||||
printf("%-8s ", "?");
|
||||
|
||||
printf("%-12.12s %s\n", ctime((time_t*)&(ut->ut_tv.tv_sec)) + 4, ut->ut_host);
|
||||
}
|
||||
printf("%-12.12s %s\n", ctime((time_t*)&(ut->ut_tv.tv_sec)) + 4, ut->ut_host);
|
||||
}
|
||||
}
|
||||
endutent();
|
||||
|
||||
|
@ -36,10 +36,10 @@
|
||||
* broken compatibility because the BusyBox policy doesn't allow them.
|
||||
* The supported options are:
|
||||
* -t test. Print the name of the files to be executed, without
|
||||
* execute them.
|
||||
* execute them.
|
||||
* -a ARG argument. Pass ARG as an argument the program executed. It can
|
||||
* be repeated to pass multiple arguments.
|
||||
* -u MASK umask. Set the umask of the program executed to MASK. */
|
||||
* be repeated to pass multiple arguments.
|
||||
* -u MASK umask. Set the umask of the program executed to MASK. */
|
||||
|
||||
/* TODO
|
||||
* done - convert calls to error in perror... and remove error()
|
||||
|
@ -34,13 +34,13 @@ typedef struct blkid_struct_dev_iterate *blkid_dev_iterate;
|
||||
* Flags for blkid_get_dev
|
||||
*
|
||||
* BLKID_DEV_CREATE Create an empty device structure if not found
|
||||
* in the cache.
|
||||
* in the cache.
|
||||
* BLKID_DEV_VERIFY Make sure the device structure corresponds
|
||||
* with reality.
|
||||
* with reality.
|
||||
* BLKID_DEV_FIND Just look up a device entry, and return NULL
|
||||
* if it is not found.
|
||||
* if it is not found.
|
||||
* BLKID_DEV_NORMAL Get a valid device structure, either from the
|
||||
* cache or by probing the device.
|
||||
* cache or by probing the device.
|
||||
*/
|
||||
#define BLKID_DEV_FIND 0x0000
|
||||
#define BLKID_DEV_CREATE 0x0001
|
||||
|
@ -70,7 +70,7 @@ blkid_loff_t blkid_get_dev_size(int fd)
|
||||
{
|
||||
int valid_blkgetsize64 = 1;
|
||||
#ifdef __linux__
|
||||
struct utsname ut;
|
||||
struct utsname ut;
|
||||
#endif
|
||||
unsigned long long size64;
|
||||
unsigned long size;
|
||||
|
@ -229,9 +229,9 @@ struct ocfs_volume_label {
|
||||
};
|
||||
|
||||
#define ocfsmajor(o) ((__u32)o.major_version[0] \
|
||||
+ (((__u32) o.major_version[1]) << 8) \
|
||||
+ (((__u32) o.major_version[2]) << 16) \
|
||||
+ (((__u32) o.major_version[3]) << 24))
|
||||
+ (((__u32) o.major_version[1]) << 8) \
|
||||
+ (((__u32) o.major_version[2]) << 16) \
|
||||
+ (((__u32) o.major_version[3]) << 24))
|
||||
#define ocfslabellen(o) ((__u32)o.label_len[0] + (((__u32) o.label_len[1]) << 8))
|
||||
#define ocfsmountlen(o) ((__u32)o.mount_len[0] + (((__u32) o.mount_len[1])<<8))
|
||||
|
||||
|
@ -162,7 +162,7 @@ skip_setflags:
|
||||
}
|
||||
|
||||
static int chattr_dir_proc(const char *dir_name, struct dirent *de,
|
||||
void *private EXT2FS_ATTR((unused)))
|
||||
void *private EXT2FS_ATTR((unused)))
|
||||
{
|
||||
/*if (strcmp(de->d_name, ".") && strcmp(de->d_name, "..")) {*/
|
||||
if (de->d_name[0] == '.' && (de->d_name[1] == '\0' || \
|
||||
|
@ -11797,8 +11797,8 @@ static int count_tags(struct buffer_head *bh, int size)
|
||||
|
||||
|
||||
/* Make sure we wrap around the log correctly! */
|
||||
#define wrap(journal, var) \
|
||||
do { \
|
||||
#define wrap(journal, var) \
|
||||
do { \
|
||||
if (var >= (journal)->j_last) \
|
||||
var -= ((journal)->j_last - (journal)->j_first); \
|
||||
} while (0)
|
||||
|
@ -35,9 +35,9 @@
|
||||
|
||||
/*
|
||||
To do fsetversion: unsigned long *ptr_version must be set to NULL.
|
||||
and unsigned long version must be set to a value
|
||||
and unsigned long version must be set to a value
|
||||
To do fgetversion: unsigned long *ptr_version must NOT be set to NULL
|
||||
and unsigned long version is ignored.
|
||||
and unsigned long version is ignored.
|
||||
TITO.
|
||||
*/
|
||||
|
||||
|
@ -53,7 +53,7 @@ int e2p_string2os(char *str)
|
||||
#ifdef TEST_PROGRAM
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
char *s;
|
||||
char *s;
|
||||
int i, os;
|
||||
|
||||
for (i=0; i <= EXT2_OS_LITES; i++) {
|
||||
|
@ -19,7 +19,7 @@ struct uuid {
|
||||
/* Returns 1 if the uuid is the NULL uuid */
|
||||
int e2p_is_null_uuid(void *uu)
|
||||
{
|
||||
__u8 *cp;
|
||||
__u8 *cp;
|
||||
int i;
|
||||
|
||||
for (i=0, cp = uu; i < 16; i++)
|
||||
|
@ -57,7 +57,7 @@ static int clear_bad_block_proc(ext2_filsys fs, blk_t *block_nr,
|
||||
errcode_t ext2fs_update_bb_inode(ext2_filsys fs, ext2_badblocks_list bb_list)
|
||||
{
|
||||
errcode_t retval;
|
||||
struct set_badblock_record rec;
|
||||
struct set_badblock_record rec;
|
||||
struct ext2_inode inode;
|
||||
|
||||
EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);
|
||||
@ -158,7 +158,7 @@ static int clear_bad_block_proc(ext2_filsys fs, blk_t *block_nr,
|
||||
struct set_badblock_record *rec = (struct set_badblock_record *)
|
||||
priv_data;
|
||||
errcode_t retval;
|
||||
unsigned long old_size;
|
||||
unsigned long old_size;
|
||||
|
||||
if (!*block_nr)
|
||||
return 0;
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*
|
||||
* bitops.c --- Bitmap frobbing code. See bitops.h for the inlined
|
||||
* routines.
|
||||
* routines.
|
||||
*
|
||||
* Copyright (C) 1993, 1994, 1995, 1996 Theodore Ts'o.
|
||||
*
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*
|
||||
* bitops.h --- Bitmap frobbing code. The byte swapping routines are
|
||||
* also included here.
|
||||
* also included here.
|
||||
*
|
||||
* Copyright (C) 1993, 1994, 1995, 1996 Theodore Ts'o.
|
||||
*
|
||||
|
@ -203,7 +203,7 @@ errcode_t ext2fs_bmap(ext2_filsys fs, ext2_ino_t ino, struct ext2_inode *inode,
|
||||
}
|
||||
|
||||
b = inode_bmap(inode, EXT2_IND_BLOCK-1);
|
||||
retval = ext2fs_alloc_block(fs, b, block_buf, &b);
|
||||
retval = ext2fs_alloc_block(fs, b, block_buf, &b);
|
||||
if (retval)
|
||||
goto done;
|
||||
inode_bmap(inode, EXT2_IND_BLOCK) = b;
|
||||
@ -226,7 +226,7 @@ errcode_t ext2fs_bmap(ext2_filsys fs, ext2_ino_t ino, struct ext2_inode *inode,
|
||||
}
|
||||
|
||||
b = inode_bmap(inode, EXT2_IND_BLOCK);
|
||||
retval = ext2fs_alloc_block(fs, b, block_buf, &b);
|
||||
retval = ext2fs_alloc_block(fs, b, block_buf, &b);
|
||||
if (retval)
|
||||
goto done;
|
||||
inode_bmap(inode, EXT2_DIND_BLOCK) = b;
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*
|
||||
* bmove.c --- Move blocks around to make way for a particular
|
||||
* filesystem structure.
|
||||
* filesystem structure.
|
||||
*
|
||||
* Copyright (C) 1997 Theodore Ts'o. This file may be redistributed
|
||||
* under the terms of the GNU Public License.
|
||||
|
@ -48,7 +48,7 @@ errcode_t ext2fs_brel_memarray_create(char *name, blk_t max_block,
|
||||
{
|
||||
ext2_brel brel = 0;
|
||||
errcode_t retval;
|
||||
struct brel_ma *ma = 0;
|
||||
struct brel_ma *ma = 0;
|
||||
size_t size;
|
||||
|
||||
*new_brel = 0;
|
||||
@ -103,7 +103,7 @@ errout:
|
||||
static errcode_t bma_put(ext2_brel brel, blk_t old,
|
||||
struct ext2_block_relocate_entry *ent)
|
||||
{
|
||||
struct brel_ma *ma;
|
||||
struct brel_ma *ma;
|
||||
|
||||
ma = brel->priv_data;
|
||||
if (old > ma->max_block)
|
||||
@ -115,7 +115,7 @@ static errcode_t bma_put(ext2_brel brel, blk_t old,
|
||||
static errcode_t bma_get(ext2_brel brel, blk_t old,
|
||||
struct ext2_block_relocate_entry *ent)
|
||||
{
|
||||
struct brel_ma *ma;
|
||||
struct brel_ma *ma;
|
||||
|
||||
ma = brel->priv_data;
|
||||
if (old > ma->max_block)
|
||||
@ -135,7 +135,7 @@ static errcode_t bma_start_iter(ext2_brel brel)
|
||||
static errcode_t bma_next(ext2_brel brel, blk_t *old,
|
||||
struct ext2_block_relocate_entry *ent)
|
||||
{
|
||||
struct brel_ma *ma;
|
||||
struct brel_ma *ma;
|
||||
|
||||
ma = brel->priv_data;
|
||||
while (++brel->current < ma->max_block) {
|
||||
@ -151,7 +151,7 @@ static errcode_t bma_next(ext2_brel brel, blk_t *old,
|
||||
|
||||
static errcode_t bma_move(ext2_brel brel, blk_t old, blk_t new)
|
||||
{
|
||||
struct brel_ma *ma;
|
||||
struct brel_ma *ma;
|
||||
|
||||
ma = brel->priv_data;
|
||||
if ((old > ma->max_block) || (new > ma->max_block))
|
||||
@ -165,7 +165,7 @@ static errcode_t bma_move(ext2_brel brel, blk_t old, blk_t new)
|
||||
|
||||
static errcode_t bma_delete(ext2_brel brel, blk_t old)
|
||||
{
|
||||
struct brel_ma *ma;
|
||||
struct brel_ma *ma;
|
||||
|
||||
ma = brel->priv_data;
|
||||
if (old > ma->max_block)
|
||||
@ -178,7 +178,7 @@ static errcode_t bma_delete(ext2_brel brel, blk_t old)
|
||||
|
||||
static errcode_t bma_free(ext2_brel brel)
|
||||
{
|
||||
struct brel_ma *ma;
|
||||
struct brel_ma *ma;
|
||||
|
||||
if (!brel)
|
||||
return 0;
|
||||
|
@ -155,7 +155,7 @@ errcode_t ext2fs_copy_dblist(ext2_dblist src, ext2_dblist *dest)
|
||||
errcode_t ext2fs_add_dir_block(ext2_dblist dblist, ext2_ino_t ino, blk_t blk,
|
||||
int blockcnt)
|
||||
{
|
||||
struct ext2_db_entry *new_entry;
|
||||
struct ext2_db_entry *new_entry;
|
||||
errcode_t retval;
|
||||
unsigned long old_size;
|
||||
|
||||
|
@ -185,10 +185,10 @@ int ext2fs_process_dir_block(ext2_filsys fs,
|
||||
break;
|
||||
}
|
||||
next:
|
||||
if (next_real_entry == offset)
|
||||
if (next_real_entry == offset)
|
||||
next_real_entry += dirent->rec_len;
|
||||
|
||||
if (ctx->flags & DIRENT_FLAG_INCLUDE_REMOVED) {
|
||||
if (ctx->flags & DIRENT_FLAG_INCLUDE_REMOVED) {
|
||||
size = ((dirent->name_len & 0xFF) + 11) & ~3;
|
||||
|
||||
if (dirent->rec_len != size) {
|
||||
|
@ -30,7 +30,7 @@ errcode_t ext2fs_read_dir_block2(ext2_filsys fs, blk_t block,
|
||||
unsigned int do_swap;
|
||||
#endif
|
||||
|
||||
retval = io_channel_read_blk(fs->io, block, 1, buf);
|
||||
retval = io_channel_read_blk(fs->io, block, 1, buf);
|
||||
if (retval)
|
||||
return retval;
|
||||
#ifdef EXT2FS_ENABLE_SWAPFS
|
||||
@ -115,11 +115,11 @@ errcode_t ext2fs_write_dir_block2(ext2_filsys fs, blk_t block,
|
||||
dirent->name_len = ext2fs_swab16(dirent->name_len);
|
||||
#endif
|
||||
}
|
||||
retval = io_channel_write_blk(fs->io, block, 1, buf);
|
||||
retval = io_channel_write_blk(fs->io, block, 1, buf);
|
||||
ext2fs_free_mem(&buf);
|
||||
return retval;
|
||||
#else
|
||||
return io_channel_write_blk(fs->io, block, 1, (char *) inbuf);
|
||||
return io_channel_write_blk(fs->io, block, 1, (char *) inbuf);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -178,7 +178,7 @@ errcode_t ext2fs_dirhash(int version, const char *name, int len,
|
||||
__u32 minor_hash = 0;
|
||||
const char *p;
|
||||
int i;
|
||||
__u32 in[8], buf[4];
|
||||
__u32 in[8], buf[4];
|
||||
|
||||
/* Initialize the default seed for the hash checksum functions */
|
||||
buf[0] = 0x67452301;
|
||||
|
@ -231,9 +231,9 @@ struct ext2_dx_countlimit {
|
||||
#define EXT2_IMAGIC_FL 0x00002000
|
||||
#define EXT3_JOURNAL_DATA_FL 0x00004000 /* file data should be journaled */
|
||||
#define EXT2_NOTAIL_FL 0x00008000 /* file tail should not be merged */
|
||||
#define EXT2_DIRSYNC_FL 0x00010000 /* Synchronous directory modifications */
|
||||
#define EXT2_DIRSYNC_FL 0x00010000 /* Synchronous directory modifications */
|
||||
#define EXT2_TOPDIR_FL 0x00020000 /* Top of directory hierarchies*/
|
||||
#define EXT3_EXTENTS_FL 0x00080000 /* Inode uses extents */
|
||||
#define EXT3_EXTENTS_FL 0x00080000 /* Inode uses extents */
|
||||
#define EXT2_RESERVED_FL 0x80000000 /* reserved for ext2 lib */
|
||||
|
||||
#define EXT2_FL_USER_VISIBLE 0x0003DFFF /* User visible flags */
|
||||
@ -501,12 +501,12 @@ struct ext2_super_block {
|
||||
__u32 s_last_orphan; /* start of list of inodes to delete */
|
||||
__u32 s_hash_seed[4]; /* HTREE hash seed */
|
||||
__u8 s_def_hash_version; /* Default hash version to use */
|
||||
__u8 s_jnl_backup_type; /* Default type of journal backup */
|
||||
__u8 s_jnl_backup_type; /* Default type of journal backup */
|
||||
__u16 s_reserved_word_pad;
|
||||
__u32 s_default_mount_opts;
|
||||
__u32 s_first_meta_bg; /* First metablock group */
|
||||
__u32 s_mkfs_time; /* When the filesystem was created */
|
||||
__u32 s_jnl_blocks[17]; /* Backup of the journal inode */
|
||||
__u32 s_jnl_blocks[17]; /* Backup of the journal inode */
|
||||
__u32 s_reserved[172]; /* Padding to the end of the block */
|
||||
};
|
||||
|
||||
|
@ -46,7 +46,7 @@ extern "C" {
|
||||
* 1032 bytes long).
|
||||
*/
|
||||
#define SUPERBLOCK_OFFSET 1024
|
||||
#define SUPERBLOCK_SIZE 1024
|
||||
#define SUPERBLOCK_SIZE 1024
|
||||
|
||||
/*
|
||||
* The last ext2fs revision level that this version of the library is
|
||||
@ -87,7 +87,7 @@ typedef struct struct_ext2_filsys *ext2_filsys;
|
||||
|
||||
struct ext2fs_struct_generic_bitmap {
|
||||
errcode_t magic;
|
||||
ext2_filsys fs;
|
||||
ext2_filsys fs;
|
||||
__u32 start, end;
|
||||
__u32 real_end;
|
||||
char * description;
|
||||
@ -96,8 +96,8 @@ struct ext2fs_struct_generic_bitmap {
|
||||
__u32 reserved[7];
|
||||
};
|
||||
|
||||
#define EXT2FS_MARK_ERROR 0
|
||||
#define EXT2FS_UNMARK_ERROR 1
|
||||
#define EXT2FS_MARK_ERROR 0
|
||||
#define EXT2FS_UNMARK_ERROR 1
|
||||
#define EXT2FS_TEST_ERROR 2
|
||||
|
||||
typedef struct ext2fs_struct_generic_bitmap *ext2fs_generic_bitmap;
|
||||
@ -194,7 +194,7 @@ struct struct_ext2_filsys {
|
||||
io_channel io;
|
||||
int flags;
|
||||
char * device_name;
|
||||
struct ext2_super_block * super;
|
||||
struct ext2_super_block * super;
|
||||
unsigned int blocksize;
|
||||
int fragsize;
|
||||
dgrp_t group_desc_count;
|
||||
|
@ -78,7 +78,7 @@ struct ext2_inode_cache_ent {
|
||||
|
||||
/* Function prototypes */
|
||||
|
||||
extern int ext2fs_process_dir_block(ext2_filsys fs,
|
||||
extern int ext2fs_process_dir_block(ext2_filsys fs,
|
||||
blk_t *blocknr,
|
||||
e2_blkcnt_t blockcnt,
|
||||
blk_t ref_block,
|
||||
|
@ -154,7 +154,7 @@ blk_t ext2fs_inode_data_blocks(ext2_filsys fs,
|
||||
struct ext2_inode *inode)
|
||||
{
|
||||
return inode->i_blocks -
|
||||
(inode->i_file_acl ? fs->blocksize >> 9 : 0);
|
||||
(inode->i_file_acl ? fs->blocksize >> 9 : 0);
|
||||
}
|
||||
|
||||
|
||||
@ -179,7 +179,7 @@ __u32 ext2fs_swab32(__u32 val)
|
||||
int ext2fs_find_first_bit_set(void * addr, unsigned size)
|
||||
{
|
||||
char *cp = (unsigned char *) addr;
|
||||
int res = 0, d0;
|
||||
int res = 0, d0;
|
||||
|
||||
if (!size)
|
||||
return 0;
|
||||
|
@ -27,7 +27,7 @@ errcode_t ext2fs_read_ext_attr(ext2_filsys fs, blk_t block, void *buf)
|
||||
{
|
||||
errcode_t retval;
|
||||
|
||||
retval = io_channel_read_blk(fs->io, block, 1, buf);
|
||||
retval = io_channel_read_blk(fs->io, block, 1, buf);
|
||||
if (retval)
|
||||
return retval;
|
||||
#ifdef EXT2FS_ENABLE_SWAPFS
|
||||
@ -55,7 +55,7 @@ errcode_t ext2fs_write_ext_attr(ext2_filsys fs, blk_t block, void *inbuf)
|
||||
} else
|
||||
#endif
|
||||
write_buf = (char *) inbuf;
|
||||
retval = io_channel_write_blk(fs->io, block, 1, write_buf);
|
||||
retval = io_channel_write_blk(fs->io, block, 1, write_buf);
|
||||
if (buf)
|
||||
ext2fs_free_mem(&buf);
|
||||
if (!retval)
|
||||
|
@ -20,14 +20,14 @@
|
||||
|
||||
struct ext2_file {
|
||||
errcode_t magic;
|
||||
ext2_filsys fs;
|
||||
ext2_filsys fs;
|
||||
ext2_ino_t ino;
|
||||
struct ext2_inode inode;
|
||||
int flags;
|
||||
int flags;
|
||||
__u64 pos;
|
||||
blk_t blockno;
|
||||
blk_t physblock;
|
||||
char *buf;
|
||||
char *buf;
|
||||
};
|
||||
|
||||
#define BMAP_BUFFER (file->buf + fs->blocksize)
|
||||
@ -36,7 +36,7 @@ errcode_t ext2fs_file_open2(ext2_filsys fs, ext2_ino_t ino,
|
||||
struct ext2_inode *inode,
|
||||
int flags, ext2_file_t *ret)
|
||||
{
|
||||
ext2_file_t file;
|
||||
ext2_file_t file;
|
||||
errcode_t retval;
|
||||
|
||||
/*
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*
|
||||
* finddev.c -- this routine attempts to find a particular device in
|
||||
* /dev
|
||||
* /dev
|
||||
*
|
||||
* Copyright (C) 2000 Theodore Ts'o.
|
||||
*
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*
|
||||
* flushb.c --- Hides system-dependent information for both syncing a
|
||||
* device to disk and to flush any buffers from disk cache.
|
||||
* device to disk and to flush any buffers from disk cache.
|
||||
*
|
||||
* Copyright (C) 2000 Theodore Ts'o.
|
||||
*
|
||||
|
@ -8,13 +8,13 @@
|
||||
* License.
|
||||
* %End-Header%
|
||||
*
|
||||
* ext2fs_get_pathname(fs, dir, ino, name)
|
||||
* ext2fs_get_pathname(fs, dir, ino, name)
|
||||
*
|
||||
* This function translates takes two inode numbers into a
|
||||
* string, placing the result in <name>. <dir> is the containing
|
||||
* directory inode, and <ino> is the inode number itself. If
|
||||
* <ino> is zero, then ext2fs_get_pathname will return pathname
|
||||
* of the the directory <dir>.
|
||||
* This function translates takes two inode numbers into a
|
||||
* string, placing the result in <name>. <dir> is the containing
|
||||
* directory inode, and <ino> is the inode number itself. If
|
||||
* <ino> is zero, then ext2fs_get_pathname will return pathname
|
||||
* of the the directory <dir>.
|
||||
*
|
||||
*/
|
||||
|
||||
|
@ -77,7 +77,7 @@ errcode_t ext2fs_get_device_size(const char *file, int blocksize,
|
||||
|
||||
dev = CreateFile(file, GENERIC_READ,
|
||||
FILE_SHARE_READ | FILE_SHARE_WRITE ,
|
||||
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||
|
||||
if (dev == INVALID_HANDLE_VALUE)
|
||||
return EBADF;
|
||||
@ -137,7 +137,7 @@ errcode_t ext2fs_get_device_size(const char *file, int blocksize,
|
||||
int fd;
|
||||
int valid_blkgetsize64 = 1;
|
||||
#ifdef __linux__
|
||||
struct utsname ut;
|
||||
struct utsname ut;
|
||||
#endif
|
||||
unsigned long long size64;
|
||||
unsigned long size;
|
||||
|
@ -157,12 +157,12 @@ errcode_t ext2fs_create_icount(ext2_filsys fs, int flags,
|
||||
|
||||
/*
|
||||
* insert_icount_el() --- Insert a new entry into the sorted list at a
|
||||
* specified position.
|
||||
* specified position.
|
||||
*/
|
||||
static struct ext2_icount_el *insert_icount_el(ext2_icount_t icount,
|
||||
ext2_ino_t ino, int pos)
|
||||
{
|
||||
struct ext2_icount_el *el;
|
||||
struct ext2_icount_el *el;
|
||||
errcode_t retval;
|
||||
ext2_ino_t new_size = 0;
|
||||
int num;
|
||||
@ -203,8 +203,8 @@ static struct ext2_icount_el *insert_icount_el(ext2_icount_t icount,
|
||||
|
||||
/*
|
||||
* get_icount_el() --- given an inode number, try to find icount
|
||||
* information in the sorted list. If the create flag is set,
|
||||
* and we can't find an entry, create one in the sorted list.
|
||||
* information in the sorted list. If the create flag is set,
|
||||
* and we can't find an entry, create one in the sorted list.
|
||||
*/
|
||||
static struct ext2_icount_el *get_icount_el(ext2_icount_t icount,
|
||||
ext2_ino_t ino, int create)
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*
|
||||
* image.c --- writes out the critical parts of the filesystem as a
|
||||
* flat file.
|
||||
* flat file.
|
||||
*
|
||||
* Copyright (C) 2000 Theodore Ts'o.
|
||||
*
|
||||
|
@ -2,7 +2,7 @@
|
||||
* ind_block.c --- indirect block I/O routines
|
||||
*
|
||||
* Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
|
||||
* 2001, 2002, 2003, 2004, 2005 by Theodore Ts'o.
|
||||
* 2001, 2002, 2003, 2004, 2005 by Theodore Ts'o.
|
||||
*
|
||||
* %Begin-Header%
|
||||
* This file may be redistributed under the terms of the GNU Public
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*
|
||||
* initialize.c --- initialize a filesystem handle given superblock
|
||||
* parameters. Used by mke2fs when initializing a filesystem.
|
||||
* parameters. Used by mke2fs when initializing a filesystem.
|
||||
*
|
||||
* Copyright (C) 1994, 1995, 1996 Theodore Ts'o.
|
||||
*
|
||||
@ -36,7 +36,7 @@
|
||||
#if defined(__FreeBSD__) && defined(EXT2_OS_FREEBSD)
|
||||
#define CREATOR_OS EXT2_OS_FREEBSD
|
||||
#else
|
||||
#if defined(LITES) && defined(EXT2_OS_LITES)
|
||||
#if defined(LITES) && defined(EXT2_OS_LITES)
|
||||
#define CREATOR_OS EXT2_OS_LITES
|
||||
#else
|
||||
#define CREATOR_OS EXT2_OS_LINUX /* by default */
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* inline.c --- Includes the inlined functions defined in the header
|
||||
* files as standalone functions, in case the application program
|
||||
* is compiled with inlining turned off.
|
||||
* files as standalone functions, in case the application program
|
||||
* is compiled with inlining turned off.
|
||||
*
|
||||
* Copyright (C) 1993, 1994 Theodore Ts'o.
|
||||
*
|
||||
|
@ -495,10 +495,10 @@ errcode_t ext2fs_get_next_inode(ext2_inode_scan scan, ext2_ino_t *ino,
|
||||
errcode_t ext2fs_read_inode_full(ext2_filsys fs, ext2_ino_t ino,
|
||||
struct ext2_inode * inode, int bufsize)
|
||||
{
|
||||
unsigned long group, block, block_nr, offset;
|
||||
char *ptr;
|
||||
unsigned long group, block, block_nr, offset;
|
||||
char *ptr;
|
||||
errcode_t retval;
|
||||
int clen, i, inodes_per_block, length;
|
||||
int clen, i, inodes_per_block, length;
|
||||
io_channel io;
|
||||
|
||||
EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);
|
||||
@ -722,7 +722,7 @@ errcode_t ext2fs_write_new_inode(ext2_filsys fs, ext2_ino_t ino,
|
||||
struct ext2_inode *inode)
|
||||
{
|
||||
struct ext2_inode *buf;
|
||||
int size = EXT2_INODE_SIZE(fs->super);
|
||||
int size = EXT2_INODE_SIZE(fs->super);
|
||||
struct ext2_inode_large *large_inode;
|
||||
|
||||
if (size == sizeof(struct ext2_inode))
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*
|
||||
* inode_io.c --- This is allows an inode in an ext2 filesystem image
|
||||
* to be accessed via the I/O manager interface.
|
||||
* to be accessed via the I/O manager interface.
|
||||
*
|
||||
* Copyright (C) 2002 Theodore Ts'o.
|
||||
*
|
||||
@ -35,7 +35,7 @@ struct inode_private_data {
|
||||
char name[32];
|
||||
ext2_file_t file;
|
||||
ext2_filsys fs;
|
||||
ext2_ino_t ino;
|
||||
ext2_ino_t ino;
|
||||
struct ext2_inode inode;
|
||||
int flags;
|
||||
struct inode_private_data *next;
|
||||
@ -75,7 +75,7 @@ errcode_t ext2fs_inode_io_intern2(ext2_filsys fs, ext2_ino_t ino,
|
||||
struct ext2_inode *inode,
|
||||
char **name)
|
||||
{
|
||||
struct inode_private_data *data;
|
||||
struct inode_private_data *data;
|
||||
errcode_t retval;
|
||||
|
||||
if ((retval = ext2fs_get_mem(sizeof(struct inode_private_data),
|
||||
|
@ -64,7 +64,7 @@ errcode_t ext2fs_irel_memarray_create(char *name, ext2_ino_t max_inode,
|
||||
{
|
||||
ext2_irel irel = 0;
|
||||
errcode_t retval;
|
||||
struct irel_ma *ma = 0;
|
||||
struct irel_ma *ma = 0;
|
||||
size_t size;
|
||||
|
||||
*new_irel = 0;
|
||||
@ -137,7 +137,7 @@ static errcode_t ima_put(ext2_irel irel, ext2_ino_t old,
|
||||
struct ext2_inode_relocate_entry *ent)
|
||||
{
|
||||
struct inode_reference_entry *ref_ent;
|
||||
struct irel_ma *ma;
|
||||
struct irel_ma *ma;
|
||||
errcode_t retval;
|
||||
size_t size, old_size;
|
||||
|
||||
@ -176,7 +176,7 @@ static errcode_t ima_put(ext2_irel irel, ext2_ino_t old,
|
||||
static errcode_t ima_get(ext2_irel irel, ext2_ino_t old,
|
||||
struct ext2_inode_relocate_entry *ent)
|
||||
{
|
||||
struct irel_ma *ma;
|
||||
struct irel_ma *ma;
|
||||
|
||||
ma = irel->priv_data;
|
||||
if (old > ma->max_inode)
|
||||
@ -190,7 +190,7 @@ static errcode_t ima_get(ext2_irel irel, ext2_ino_t old,
|
||||
static errcode_t ima_get_by_orig(ext2_irel irel, ext2_ino_t orig, ext2_ino_t *old,
|
||||
struct ext2_inode_relocate_entry *ent)
|
||||
{
|
||||
struct irel_ma *ma;
|
||||
struct irel_ma *ma;
|
||||
ext2_ino_t ino;
|
||||
|
||||
ma = irel->priv_data;
|
||||
@ -213,7 +213,7 @@ static errcode_t ima_start_iter(ext2_irel irel)
|
||||
static errcode_t ima_next(ext2_irel irel, ext2_ino_t *old,
|
||||
struct ext2_inode_relocate_entry *ent)
|
||||
{
|
||||
struct irel_ma *ma;
|
||||
struct irel_ma *ma;
|
||||
|
||||
ma = irel->priv_data;
|
||||
while (++irel->current < ma->max_inode) {
|
||||
@ -230,7 +230,7 @@ static errcode_t ima_next(ext2_irel irel, ext2_ino_t *old,
|
||||
static errcode_t ima_add_ref(ext2_irel irel, ext2_ino_t ino,
|
||||
struct ext2_inode_reference *ref)
|
||||
{
|
||||
struct irel_ma *ma;
|
||||
struct irel_ma *ma;
|
||||
size_t size;
|
||||
struct inode_reference_entry *ref_ent;
|
||||
struct ext2_inode_relocate_entry *ent;
|
||||
@ -265,7 +265,7 @@ static errcode_t ima_add_ref(ext2_irel irel, ext2_ino_t ino,
|
||||
|
||||
static errcode_t ima_start_iter_ref(ext2_irel irel, ext2_ino_t ino)
|
||||
{
|
||||
struct irel_ma *ma;
|
||||
struct irel_ma *ma;
|
||||
|
||||
ma = irel->priv_data;
|
||||
if (ino > ma->max_inode)
|
||||
@ -280,7 +280,7 @@ static errcode_t ima_start_iter_ref(ext2_irel irel, ext2_ino_t ino)
|
||||
static errcode_t ima_next_ref(ext2_irel irel,
|
||||
struct ext2_inode_reference *ref)
|
||||
{
|
||||
struct irel_ma *ma;
|
||||
struct irel_ma *ma;
|
||||
struct inode_reference_entry *ref_ent;
|
||||
|
||||
ma = irel->priv_data;
|
||||
@ -300,7 +300,7 @@ static errcode_t ima_next_ref(ext2_irel irel,
|
||||
|
||||
static errcode_t ima_move(ext2_irel irel, ext2_ino_t old, ext2_ino_t new)
|
||||
{
|
||||
struct irel_ma *ma;
|
||||
struct irel_ma *ma;
|
||||
|
||||
ma = irel->priv_data;
|
||||
if ((old > ma->max_inode) || (new > ma->max_inode))
|
||||
@ -323,7 +323,7 @@ static errcode_t ima_move(ext2_irel irel, ext2_ino_t old, ext2_ino_t new)
|
||||
|
||||
static errcode_t ima_delete(ext2_irel irel, ext2_ino_t old)
|
||||
{
|
||||
struct irel_ma *ma;
|
||||
struct irel_ma *ma;
|
||||
|
||||
ma = irel->priv_data;
|
||||
if (old > ma->max_inode)
|
||||
@ -343,7 +343,7 @@ static errcode_t ima_delete(ext2_irel irel, ext2_ino_t old)
|
||||
|
||||
static errcode_t ima_free(ext2_irel irel)
|
||||
{
|
||||
struct irel_ma *ma;
|
||||
struct irel_ma *ma;
|
||||
ext2_ino_t ino;
|
||||
|
||||
if (!irel)
|
||||
|
@ -43,12 +43,12 @@
|
||||
static errcode_t check_mntent_file(const char *mtab_file, const char *file,
|
||||
int *mount_flags, char *mtpt, int mtlen)
|
||||
{
|
||||
struct mntent *mnt;
|
||||
struct mntent *mnt;
|
||||
struct stat st_buf;
|
||||
errcode_t retval = 0;
|
||||
dev_t file_dev=0, file_rdev=0;
|
||||
ino_t file_ino=0;
|
||||
FILE *f;
|
||||
FILE *f;
|
||||
int fd;
|
||||
|
||||
*mount_flags = 0;
|
||||
@ -197,31 +197,31 @@ static errcode_t check_getmntinfo(const char *file, int *mount_flags,
|
||||
char *mtpt, int mtlen)
|
||||
{
|
||||
struct statfs *mp;
|
||||
int len, n;
|
||||
const char *s1;
|
||||
int len, n;
|
||||
const char *s1;
|
||||
char *s2;
|
||||
|
||||
n = getmntinfo(&mp, MNT_NOWAIT);
|
||||
if (n == 0)
|
||||
n = getmntinfo(&mp, MNT_NOWAIT);
|
||||
if (n == 0)
|
||||
return errno;
|
||||
|
||||
len = sizeof(_PATH_DEV) - 1;
|
||||
s1 = file;
|
||||
if (strncmp(_PATH_DEV, s1, len) == 0)
|
||||
s1 += len;
|
||||
len = sizeof(_PATH_DEV) - 1;
|
||||
s1 = file;
|
||||
if (strncmp(_PATH_DEV, s1, len) == 0)
|
||||
s1 += len;
|
||||
|
||||
*mount_flags = 0;
|
||||
while (--n >= 0) {
|
||||
s2 = mp->f_mntfromname;
|
||||
if (strncmp(_PATH_DEV, s2, len) == 0) {
|
||||
s2 += len - 1;
|
||||
*s2 = 'r';
|
||||
}
|
||||
if (strcmp(s1, s2) == 0 || strcmp(s1, &s2[1]) == 0) {
|
||||
while (--n >= 0) {
|
||||
s2 = mp->f_mntfromname;
|
||||
if (strncmp(_PATH_DEV, s2, len) == 0) {
|
||||
s2 += len - 1;
|
||||
*s2 = 'r';
|
||||
}
|
||||
if (strcmp(s1, s2) == 0 || strcmp(s1, &s2[1]) == 0) {
|
||||
*mount_flags = EXT2_MF_MOUNTED;
|
||||
break;
|
||||
}
|
||||
++mp;
|
||||
++mp;
|
||||
}
|
||||
if (mtpt)
|
||||
strncpy(mtpt, mp->f_mntonname, mtlen);
|
||||
@ -270,7 +270,7 @@ static int is_swap_device(const char *file)
|
||||
ret++;
|
||||
break;
|
||||
}
|
||||
#endif /* __GNU__ */
|
||||
#endif /* __GNU__ */
|
||||
}
|
||||
fclose(f);
|
||||
return ret;
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*
|
||||
* jfs_dat.h --- stripped down header file which only contains the JFS
|
||||
* on-disk data structures
|
||||
* on-disk data structures
|
||||
*/
|
||||
|
||||
#define JFS_MAGIC_NUMBER 0xc03b3998U /* The first 4 bytes of /dev/random! */
|
||||
|
@ -51,7 +51,7 @@ extern int journal_enable_debug;
|
||||
if ((n) <= journal_enable_debug) { \
|
||||
printk (KERN_DEBUG "(%s, %d): %s: ", \
|
||||
__FILE__, __LINE__, __FUNCTION__); \
|
||||
printk (f, ## a); \
|
||||
printk (f, ## a); \
|
||||
} \
|
||||
} while (0)
|
||||
#else
|
||||
@ -161,9 +161,9 @@ typedef struct journal_superblock_s
|
||||
|
||||
/* 0x0024 */
|
||||
/* Remaining fields are only valid in a version-2 superblock */
|
||||
__u32 s_feature_compat; /* compatible feature set */
|
||||
__u32 s_feature_incompat; /* incompatible feature set */
|
||||
__u32 s_feature_ro_compat; /* readonly-compatible feature set */
|
||||
__u32 s_feature_compat; /* compatible feature set */
|
||||
__u32 s_feature_incompat; /* incompatible feature set */
|
||||
__u32 s_feature_ro_compat; /* readonly-compatible feature set */
|
||||
/* 0x0030 */
|
||||
__u8 s_uuid[16]; /* 128-bit uuid for journal */
|
||||
|
||||
@ -336,18 +336,18 @@ struct transaction_s
|
||||
unsigned long t_log_start;
|
||||
|
||||
/* Doubly-linked circular list of all inodes owned by this
|
||||
transaction */ /* AKPM: unused */
|
||||
transaction */ /* AKPM: unused */
|
||||
struct inode * t_ilist;
|
||||
|
||||
/* Number of buffers on the t_buffers list */
|
||||
int t_nr_buffers;
|
||||
|
||||
/* Doubly-linked circular list of all buffers reserved but not
|
||||
yet modified by this transaction */
|
||||
yet modified by this transaction */
|
||||
struct journal_head * t_reserved_list;
|
||||
|
||||
/* Doubly-linked circular list of all metadata buffers owned by this
|
||||
transaction */
|
||||
transaction */
|
||||
struct journal_head * t_buffers;
|
||||
|
||||
/*
|
||||
@ -365,8 +365,8 @@ struct transaction_s
|
||||
struct journal_head * t_async_datalist;
|
||||
|
||||
/* Doubly-linked circular list of all forget buffers (superceded
|
||||
buffers which we can un-checkpoint once this transaction
|
||||
commits) */
|
||||
buffers which we can un-checkpoint once this transaction
|
||||
commits) */
|
||||
struct journal_head * t_forget;
|
||||
|
||||
/*
|
||||
@ -377,17 +377,17 @@ struct transaction_s
|
||||
struct journal_head * t_checkpoint_list;
|
||||
|
||||
/* Doubly-linked circular list of temporary buffers currently
|
||||
undergoing IO in the log */
|
||||
undergoing IO in the log */
|
||||
struct journal_head * t_iobuf_list;
|
||||
|
||||
/* Doubly-linked circular list of metadata buffers being
|
||||
shadowed by log IO. The IO buffers on the iobuf list and the
|
||||
shadow buffers on this list match each other one for one at
|
||||
all times. */
|
||||
shadowed by log IO. The IO buffers on the iobuf list and the
|
||||
shadow buffers on this list match each other one for one at
|
||||
all times. */
|
||||
struct journal_head * t_shadow_list;
|
||||
|
||||
/* Doubly-linked circular list of control buffers being written
|
||||
to the log. */
|
||||
to the log. */
|
||||
struct journal_head * t_log_list;
|
||||
|
||||
/* Number of outstanding updates running on this transaction */
|
||||
@ -454,7 +454,7 @@ struct journal_s
|
||||
transaction_t * j_checkpoint_transactions;
|
||||
|
||||
/* Wait queue for waiting for a locked transaction to start
|
||||
committing, or for a barrier lock to be released */
|
||||
committing, or for a barrier lock to be released */
|
||||
wait_queue_head_t j_wait_transaction_locked;
|
||||
|
||||
/* Wait queue for waiting for checkpointing to complete */
|
||||
@ -473,7 +473,7 @@ struct journal_s
|
||||
wait_queue_head_t j_wait_updates;
|
||||
|
||||
/* Semaphore for locking against concurrent checkpoints */
|
||||
struct semaphore j_checkpoint_sem;
|
||||
struct semaphore j_checkpoint_sem;
|
||||
|
||||
/* The main journal lock, used by lock_journal() */
|
||||
struct semaphore j_sem;
|
||||
@ -546,7 +546,7 @@ struct journal_s
|
||||
struct list_head j_all_journals;
|
||||
|
||||
/* The revoke table: maintains the list of revoked blocks in the
|
||||
current transaction. */
|
||||
current transaction. */
|
||||
struct jbd_revoke_table_s *j_revoke;
|
||||
};
|
||||
|
||||
@ -770,7 +770,7 @@ static inline void journal_abort_handle(handle_t *handle)
|
||||
/* Not all architectures define BUG() */
|
||||
#ifndef BUG
|
||||
#define BUG() do { \
|
||||
printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \
|
||||
printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \
|
||||
* ((char *) 0) = 0; \
|
||||
} while (0)
|
||||
#endif /* BUG */
|
||||
|
@ -107,6 +107,6 @@ static __inline__ void list_splice(struct list_head *list, struct list_head *hea
|
||||
((type *)((char *)(ptr)-(unsigned long)(&((type *)0)->member)))
|
||||
|
||||
#define list_for_each(pos, head) \
|
||||
for (pos = (head)->next; pos != (head); pos = pos->next)
|
||||
for (pos = (head)->next; pos != (head); pos = pos->next)
|
||||
|
||||
#endif
|
||||
|
@ -227,7 +227,7 @@ static errcode_t write_journal_inode(ext2_filsys fs, ext2_ino_t journal_ino,
|
||||
if ((retval = ext2fs_read_inode(fs, journal_ino, &inode)))
|
||||
goto errout;
|
||||
|
||||
inode.i_size += fs->blocksize * size;
|
||||
inode.i_size += fs->blocksize * size;
|
||||
inode.i_blocks += (fs->blocksize / 512) * es.newblocks;
|
||||
inode.i_mtime = inode.i_ctime = time(0);
|
||||
inode.i_links_count = 1;
|
||||
@ -393,7 +393,7 @@ main(int argc, char **argv)
|
||||
{
|
||||
errcode_t retval;
|
||||
char *device_name;
|
||||
ext2_filsys fs;
|
||||
ext2_filsys fs;
|
||||
|
||||
if (argc < 2) {
|
||||
fprintf(stderr, "Usage: %s filesystem\n", argv[0]);
|
||||
|
@ -85,12 +85,12 @@ static errcode_t dir_namei(ext2_filsys fs, ext2_ino_t root, ext2_ino_t dir,
|
||||
errcode_t retval;
|
||||
|
||||
if ((c = *pathname) == '/') {
|
||||
dir = root;
|
||||
dir = root;
|
||||
pathname++;
|
||||
pathlen--;
|
||||
}
|
||||
while (1) {
|
||||
thisname = pathname;
|
||||
thisname = pathname;
|
||||
for (len=0; --pathlen >= 0;len++) {
|
||||
c = *(pathname++);
|
||||
if (c == '/')
|
||||
@ -100,10 +100,10 @@ static errcode_t dir_namei(ext2_filsys fs, ext2_ino_t root, ext2_ino_t dir,
|
||||
break;
|
||||
retval = ext2fs_lookup (fs, dir, thisname, len, buf, &inode);
|
||||
if (retval) return retval;
|
||||
retval = follow_link (fs, root, dir, inode,
|
||||
retval = follow_link (fs, root, dir, inode,
|
||||
link_count, buf, &dir);
|
||||
if (retval) return retval;
|
||||
}
|
||||
if (retval) return retval;
|
||||
}
|
||||
*name = thisname;
|
||||
*namelen = len;
|
||||
*res_inode = dir;
|
||||
|
@ -28,7 +28,7 @@
|
||||
errcode_t ext2fs_new_dir_block(ext2_filsys fs, ext2_ino_t dir_ino,
|
||||
ext2_ino_t parent_ino, char **block)
|
||||
{
|
||||
struct ext2_dir_entry *dir = NULL;
|
||||
struct ext2_dir_entry *dir = NULL;
|
||||
errcode_t retval;
|
||||
char *buf;
|
||||
int rec_len;
|
||||
|
@ -69,12 +69,12 @@ errcode_t ext2fs_open(const char *name, int flags, int superblock,
|
||||
|
||||
/*
|
||||
* Note: if superblock is non-zero, block-size must also be non-zero.
|
||||
* Superblock and block_size can be zero to use the default size.
|
||||
* Superblock and block_size can be zero to use the default size.
|
||||
*
|
||||
* Valid flags for ext2fs_open()
|
||||
*
|
||||
* EXT2_FLAG_RW - Open the filesystem for read/write.
|
||||
* EXT2_FLAG_FORCE - Open the filesystem even if some of the
|
||||
* EXT2_FLAG_RW - Open the filesystem for read/write.
|
||||
* EXT2_FLAG_FORCE - Open the filesystem even if some of the
|
||||
* features aren't supported.
|
||||
* EXT2_FLAG_JOURNAL_DEV_OK - Open an ext3 journal device
|
||||
*/
|
||||
|
@ -53,7 +53,7 @@ static void ext2fs_swap_bitmap(ext2_filsys fs, char *bitmap, int nbytes)
|
||||
|
||||
errcode_t ext2fs_write_inode_bitmap(ext2_filsys fs)
|
||||
{
|
||||
dgrp_t i;
|
||||
dgrp_t i;
|
||||
size_t nbytes;
|
||||
errcode_t retval;
|
||||
char * inode_bitmap = fs->inode_map->bitmap;
|
||||
@ -95,7 +95,7 @@ errcode_t ext2fs_write_inode_bitmap(ext2_filsys fs)
|
||||
|
||||
errcode_t ext2fs_write_block_bitmap (ext2_filsys fs)
|
||||
{
|
||||
dgrp_t i;
|
||||
dgrp_t i;
|
||||
unsigned int j;
|
||||
int nbytes;
|
||||
unsigned int nbits;
|
||||
|
@ -23,7 +23,7 @@
|
||||
#ifdef EXT2FS_ENABLE_SWAPFS
|
||||
void ext2fs_swap_super(struct ext2_super_block * sb)
|
||||
{
|
||||
int i;
|
||||
int i;
|
||||
sb->s_inodes_count = ext2fs_swab32(sb->s_inodes_count);
|
||||
sb->s_blocks_count = ext2fs_swab32(sb->s_blocks_count);
|
||||
sb->s_r_blocks_count = ext2fs_swab32(sb->s_r_blocks_count);
|
||||
|
@ -172,10 +172,10 @@ static errcode_t test_open(const char *name, int flags, io_channel *channel)
|
||||
goto cleanup;
|
||||
} else
|
||||
data->real = 0;
|
||||
data->read_blk = test_io_cb_read_blk;
|
||||
data->write_blk = test_io_cb_write_blk;
|
||||
data->set_blksize = test_io_cb_set_blksize;
|
||||
data->write_byte = test_io_cb_write_byte;
|
||||
data->read_blk = test_io_cb_read_blk;
|
||||
data->write_blk = test_io_cb_write_blk;
|
||||
data->set_blksize = test_io_cb_set_blksize;
|
||||
data->write_byte = test_io_cb_write_byte;
|
||||
|
||||
data->outfile = NULL;
|
||||
if ((value = getenv("TEST_IO_LOGFILE")) != NULL)
|
||||
|
@ -1,13 +1,13 @@
|
||||
/*
|
||||
* unix_io.c --- This is the Unix (well, really POSIX) implementation
|
||||
* of the I/O manager.
|
||||
* of the I/O manager.
|
||||
*
|
||||
* Implements a one-block write-through cache.
|
||||
*
|
||||
* Includes support for Windows NT support under Cygwin.
|
||||
*
|
||||
* Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
|
||||
* 2002 by Theodore Ts'o.
|
||||
* 2002 by Theodore Ts'o.
|
||||
*
|
||||
* %Begin-Header%
|
||||
* This file may be redistributed under the terms of the GNU Public
|
||||
@ -168,7 +168,7 @@ static errcode_t raw_read_blk(io_channel channel,
|
||||
location = ((ext2_loff_t) block * channel->block_size) + data->offset;
|
||||
#ifdef DEBUG
|
||||
printf("count=%d, size=%d, block=%d, blk_size=%d, location=%lx\n",
|
||||
count, size, block, channel->block_size, location);
|
||||
count, size, block, channel->block_size, location);
|
||||
#endif
|
||||
if (ext2fs_llseek(data->dev, location, SEEK_SET) != location) {
|
||||
retval = errno ? errno : EXT2_ET_LLSEEK_FAILED;
|
||||
@ -376,7 +376,7 @@ static errcode_t unix_open(const char *name, int flags, io_channel *channel)
|
||||
int open_flags;
|
||||
struct stat st;
|
||||
#ifdef __linux__
|
||||
struct utsname ut;
|
||||
struct utsname ut;
|
||||
#endif
|
||||
|
||||
if (name == 0)
|
||||
|
@ -98,7 +98,7 @@ static void lsattr_args(const char *name)
|
||||
}
|
||||
|
||||
static int lsattr_dir_proc(const char *dir_name, struct dirent *de,
|
||||
void *private EXT2FS_ATTR((unused)))
|
||||
void *private EXT2FS_ATTR((unused)))
|
||||
{
|
||||
STRUCT_STAT st;
|
||||
char *path;
|
||||
|
@ -107,9 +107,9 @@ static const struct mke2fs_defaults settings[] = {
|
||||
{ default_str, 3, 1024, 8192 },
|
||||
{ "journal", 0, 4096, 8192 },
|
||||
{ "news", 0, 4096, 4096 },
|
||||
{ "largefile", 0, 4096, 1024 * 1024 },
|
||||
{ "largefile", 0, 4096, 1024 * 1024 },
|
||||
{ "largefile4", 0, 4096, 4096 * 1024 },
|
||||
{ 0, 0, 0, 0},
|
||||
{ 0, 0, 0, 0},
|
||||
};
|
||||
|
||||
static void set_fs_defaults(const char *fs_type,
|
||||
@ -572,7 +572,7 @@ static void zap_sector(ext2_filsys fs, int sect, int nsect)
|
||||
|
||||
static void create_journal_dev(ext2_filsys fs)
|
||||
{
|
||||
struct progress_struct progress;
|
||||
struct progress_struct progress;
|
||||
errcode_t retval;
|
||||
char *buf;
|
||||
char *fmt = "%s journal superblock";
|
||||
@ -679,7 +679,7 @@ static int set_os(struct ext2_super_block *sb, char *os)
|
||||
if((sb->s_creator_os = e2p_string2os(os)) >= 0) {
|
||||
return 1;
|
||||
} else if (!strcasecmp("GNU", os)) {
|
||||
sb->s_creator_os = EXT2_OS_HURD;
|
||||
sb->s_creator_os = EXT2_OS_HURD;
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
|
@ -100,7 +100,7 @@ void check_mount(const char *device, int force, const char *type)
|
||||
}
|
||||
|
||||
void parse_journal_opts(char **journal_device, int *journal_flags,
|
||||
int *journal_size, const char *opts)
|
||||
int *journal_size, const char *opts)
|
||||
{
|
||||
char *buf, *token, *next, *p, *arg;
|
||||
int journal_usage = 0;
|
||||
|
@ -63,8 +63,8 @@
|
||||
#include "uuidP.h"
|
||||
|
||||
#ifdef HAVE_SRANDOM
|
||||
#define srand(x) srandom(x)
|
||||
#define rand() random()
|
||||
#define srand(x) srandom(x)
|
||||
#define rand() random()
|
||||
#endif
|
||||
|
||||
static int get_random_fd(void)
|
||||
@ -127,12 +127,12 @@ static void get_random_bytes(void *buf, int nbytes)
|
||||
static int get_node_id(unsigned char *node_id)
|
||||
{
|
||||
#ifdef HAVE_NET_IF_H
|
||||
int sd;
|
||||
struct ifreq ifr, *ifrp;
|
||||
struct ifconf ifc;
|
||||
int sd;
|
||||
struct ifreq ifr, *ifrp;
|
||||
struct ifconf ifc;
|
||||
char buf[1024];
|
||||
int n, i;
|
||||
unsigned char *a;
|
||||
unsigned char *a;
|
||||
#ifdef HAVE_NET_IF_DL_H
|
||||
struct sockaddr_dl *sdlp;
|
||||
#endif
|
||||
@ -214,7 +214,7 @@ static int get_clock(uint32_t *clock_high, uint32_t *clock_low, uint16_t *ret_cl
|
||||
static int adjustment = 0;
|
||||
static struct timeval last = {0, 0};
|
||||
static uint16_t clock_seq;
|
||||
struct timeval tv;
|
||||
struct timeval tv;
|
||||
unsigned long long clock_reg;
|
||||
|
||||
try_again:
|
||||
|
@ -42,7 +42,7 @@
|
||||
int uuid_parse(const char *in, uuid_t uu)
|
||||
{
|
||||
struct uuid uuid;
|
||||
int i;
|
||||
int i;
|
||||
const char *cp;
|
||||
char buf[3];
|
||||
|
||||
|
@ -42,8 +42,8 @@
|
||||
typedef unsigned char uuid_t[16];
|
||||
|
||||
/* UUID Variant definitions */
|
||||
#define UUID_VARIANT_NCS 0
|
||||
#define UUID_VARIANT_DCE 1
|
||||
#define UUID_VARIANT_NCS 0
|
||||
#define UUID_VARIANT_DCE 1
|
||||
#define UUID_VARIANT_MICROSOFT 2
|
||||
#define UUID_VARIANT_OTHER 3
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*
|
||||
* uuid_time.c --- Interpret the time field from a uuid. This program
|
||||
* violates the UUID abstraction barrier by reaching into the guts
|
||||
* violates the UUID abstraction barrier by reaching into the guts
|
||||
* of a UUID and interpreting it.
|
||||
*
|
||||
* Copyright (C) 1998, 1999 Theodore Ts'o.
|
||||
|
26
editors/vi.c
26
editors/vi.c
@ -1673,13 +1673,13 @@ static Byte find_range(Byte ** start, Byte ** stop, Byte c)
|
||||
q = dot;
|
||||
} else if (strchr("wW", c)) {
|
||||
do_cmd(c); // execute movement cmd
|
||||
// if we are at the next word's first char
|
||||
// step back one char
|
||||
// but check the possibilities when it is true
|
||||
// if we are at the next word's first char
|
||||
// step back one char
|
||||
// but check the possibilities when it is true
|
||||
if (dot > text && ((isspace(dot[-1]) && !isspace(dot[0]))
|
||||
|| (ispunct(dot[-1]) && !ispunct(dot[0]))
|
||||
|| (isalnum(dot[-1]) && !isalnum(dot[0]))))
|
||||
dot--; // move back off of next word
|
||||
|| (ispunct(dot[-1]) && !ispunct(dot[0]))
|
||||
|| (isalnum(dot[-1]) && !isalnum(dot[0]))))
|
||||
dot--; // move back off of next word
|
||||
if (dot > text && *dot == '\n')
|
||||
dot--; // stay off NL
|
||||
q = dot;
|
||||
@ -2405,7 +2405,7 @@ static Byte *get_input_line(Byte * prompt) // get input line- use "status line"
|
||||
if (c == '\n' || c == '\r' || c == 27)
|
||||
break; // is this end of input
|
||||
if (c == erase_char || c == 8 || c == 127) {
|
||||
// user wants to erase prev char
|
||||
// user wants to erase prev char
|
||||
i--; // backup to prev char
|
||||
buf[i] = '\0'; // erase the char
|
||||
buf[i + 1] = '\0'; // null terminate buffer
|
||||
@ -3754,11 +3754,11 @@ key_cmd_mode:
|
||||
end_cmd_q(); // stop adding to q
|
||||
break;
|
||||
case 't': // t- move to char prior to next x
|
||||
last_forward_char = get_one_char();
|
||||
do_cmd(';');
|
||||
if (*dot == last_forward_char)
|
||||
dot_left();
|
||||
last_forward_char= 0;
|
||||
last_forward_char = get_one_char();
|
||||
do_cmd(';');
|
||||
if (*dot == last_forward_char)
|
||||
dot_left();
|
||||
last_forward_char= 0;
|
||||
break;
|
||||
case 'w': // w- forward a word
|
||||
if (cmdcnt-- > 1) {
|
||||
@ -4047,4 +4047,4 @@ static void crash_test()
|
||||
}
|
||||
return;
|
||||
}
|
||||
#endif /* CONFIG_FEATURE_VI_CRASHME */
|
||||
#endif /* CONFIG_FEATURE_VI_CRASHME */
|
||||
|
@ -1873,8 +1873,8 @@
|
||||
#ifdef CONFIG_FEATURE_MDEV_CONFIG
|
||||
#define mdev_notes_usage \
|
||||
"The mdev config file contains lines that look like:\n" \
|
||||
" hd[a-z][0-9]* 0:3 660\n\n" \
|
||||
"That's device name (with regex match), uid:gid, and permissions.\n\n" \
|
||||
" hd[a-z][0-9]* 0:3 660\n\n" \
|
||||
"That's device name (with regex match), uid:gid, and permissions.\n\n" \
|
||||
"Optionally, that can be followed (on the same line) by an asterisk\n" \
|
||||
"and a command line to run after creating the corresponding device(s),\n"\
|
||||
"ala:\n\n" \
|
||||
|
@ -462,7 +462,7 @@ static pid_t run(const struct init_action *a)
|
||||
break;
|
||||
}
|
||||
/* FIXME handle other errors */
|
||||
}
|
||||
}
|
||||
|
||||
/* See if stealing the controlling tty back is necessary */
|
||||
pgrp = tcgetpgrp(0);
|
||||
|
@ -119,7 +119,7 @@ int copy_file(const char *source, const char *dest, int flags)
|
||||
status = -1;
|
||||
}
|
||||
} else if (S_ISREG(source_stat.st_mode) || (flags & FILEUTILS_DEREFERENCE))
|
||||
{
|
||||
{
|
||||
int src_fd;
|
||||
int dst_fd;
|
||||
#ifdef CONFIG_FEATURE_PRESERVE_HARDLINKS
|
||||
|
@ -61,7 +61,7 @@ int correct_password ( const struct passwd *pw )
|
||||
}
|
||||
else
|
||||
#endif
|
||||
correct = pw-> pw_passwd;
|
||||
correct = pw-> pw_passwd;
|
||||
|
||||
if ( correct == 0 || correct[0] == '\0' )
|
||||
return 1;
|
||||
|
@ -695,7 +695,7 @@ void bb_dump_add(const char *fmt)
|
||||
|
||||
/* start new linked list of format units */
|
||||
/* NOSTRICT */
|
||||
tfs = (FS *) xcalloc(1,sizeof(FS)); /*DBU:[dave@cray.com] start out NULL */
|
||||
tfs = (FS *) xcalloc(1,sizeof(FS)); /*DBU:[dave@cray.com] start out NULL */
|
||||
if (!bb_dump_fshead) {
|
||||
bb_dump_fshead = tfs;
|
||||
} else {
|
||||
|
@ -212,7 +212,7 @@ static void sha1_end(unsigned char hval[], struct sha1_ctx_t *ctx)
|
||||
ctx->wbuf[cnt++] = 0;
|
||||
|
||||
/* assemble the eight byte counter in the buffer in big-endian */
|
||||
/* format */
|
||||
/* format */
|
||||
|
||||
ctx->wbuf[14] = swap_b32((ctx->count[1] << 3) | (ctx->count[0] >> 29));
|
||||
ctx->wbuf[15] = swap_b32(ctx->count[0] << 3);
|
||||
@ -492,12 +492,12 @@ static void md5_hash_block(const void *buffer, size_t len, struct md5_ctx_t *ctx
|
||||
|
||||
# define OP(a, b, c, d, s, T) \
|
||||
do \
|
||||
{ \
|
||||
{ \
|
||||
a += FF (b, c, d) + (*cwp++ = SWAP (*words)) + T; \
|
||||
++words; \
|
||||
CYCLIC (a, s); \
|
||||
a += b; \
|
||||
} \
|
||||
} \
|
||||
while (0)
|
||||
|
||||
/* It is unfortunate that C does not provide an operator for
|
||||
|
@ -206,8 +206,8 @@ int INET6_resolve(const char *name, struct sockaddr_in6 *sin6)
|
||||
|
||||
#ifndef IN6_IS_ADDR_UNSPECIFIED
|
||||
# define IN6_IS_ADDR_UNSPECIFIED(a) \
|
||||
(((__u32 *) (a))[0] == 0 && ((__u32 *) (a))[1] == 0 && \
|
||||
((__u32 *) (a))[2] == 0 && ((__u32 *) (a))[3] == 0)
|
||||
(((__u32 *) (a))[0] == 0 && ((__u32 *) (a))[1] == 0 && \
|
||||
((__u32 *) (a))[2] == 0 && ((__u32 *) (a))[3] == 0)
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -65,7 +65,7 @@
|
||||
/* Using either the original stdio implementation (from dev86) or
|
||||
* my original stdio rewrite. Macros were:
|
||||
* #define ferror(fp) (((fp)->mode&__MODE_ERR) != 0)
|
||||
* #define feof(fp) (((fp)->mode&__MODE_EOF) != 0)
|
||||
* #define feof(fp) (((fp)->mode&__MODE_EOF) != 0)
|
||||
* #define clearerr(fp) ((fp)->mode &= ~(__MODE_EOF|__MODE_ERR),0)
|
||||
*/
|
||||
#define SET_FERROR_UNLOCKED(S) ((S)->mode |= __MODE_ERR)
|
||||
|
@ -70,7 +70,7 @@ char bb_process_escape_sequence(const char **ptr)
|
||||
if (d >= base) {
|
||||
#ifdef WANT_HEX_ESCAPES
|
||||
if ((base == 16) && (!--num_digits)) {
|
||||
/* return '\\'; */
|
||||
/* return '\\'; */
|
||||
--q;
|
||||
}
|
||||
#endif
|
||||
|
@ -81,7 +81,7 @@ void setup_environment ( const char *shell, int loginshell, int changeenv, const
|
||||
}
|
||||
else if ( changeenv ) {
|
||||
/* Set HOME, SHELL, and if not becoming a super-user,
|
||||
USER and LOGNAME. */
|
||||
USER and LOGNAME. */
|
||||
xsetenv ( "HOME", pw-> pw_dir );
|
||||
xsetenv ( "SHELL", shell );
|
||||
if ( pw-> pw_uid ) {
|
||||
|
@ -75,7 +75,7 @@ unsigned long bb_xgetularg_bnd_sfx(const char *arg, int base,
|
||||
++e;
|
||||
r *= suffixes->mult;
|
||||
break;
|
||||
}
|
||||
}
|
||||
++suffixes;
|
||||
}
|
||||
}
|
||||
|
@ -220,7 +220,7 @@ int sgetspent_r(const char *string, struct spwd *result_buf,
|
||||
|
||||
#ifdef L_getpwnam_r
|
||||
#define GETXXKEY_R_FUNC getpwnam_r
|
||||
#define GETXXKEY_R_PARSER __parsepwent
|
||||
#define GETXXKEY_R_PARSER __parsepwent
|
||||
#define GETXXKEY_R_ENTTYPE struct passwd
|
||||
#define GETXXKEY_R_TEST(ENT) (!strcmp((ENT)->pw_name, key))
|
||||
#define DO_GETXXKEY_R_KEYTYPE const char *__restrict
|
||||
@ -230,7 +230,7 @@ int sgetspent_r(const char *string, struct spwd *result_buf,
|
||||
|
||||
#ifdef L_getgrnam_r
|
||||
#define GETXXKEY_R_FUNC getgrnam_r
|
||||
#define GETXXKEY_R_PARSER __parsegrent
|
||||
#define GETXXKEY_R_PARSER __parsegrent
|
||||
#define GETXXKEY_R_ENTTYPE struct group
|
||||
#define GETXXKEY_R_TEST(ENT) (!strcmp((ENT)->gr_name, key))
|
||||
#define DO_GETXXKEY_R_KEYTYPE const char *__restrict
|
||||
@ -240,7 +240,7 @@ int sgetspent_r(const char *string, struct spwd *result_buf,
|
||||
|
||||
#ifdef L_getspnam_r
|
||||
#define GETXXKEY_R_FUNC getspnam_r
|
||||
#define GETXXKEY_R_PARSER __parsespent
|
||||
#define GETXXKEY_R_PARSER __parsespent
|
||||
#define GETXXKEY_R_ENTTYPE struct spwd
|
||||
#define GETXXKEY_R_TEST(ENT) (!strcmp((ENT)->sp_namp, key))
|
||||
#define DO_GETXXKEY_R_KEYTYPE const char *__restrict
|
||||
@ -250,7 +250,7 @@ int sgetspent_r(const char *string, struct spwd *result_buf,
|
||||
|
||||
#ifdef L_getpwuid_r
|
||||
#define GETXXKEY_R_FUNC getpwuid_r
|
||||
#define GETXXKEY_R_PARSER __parsepwent
|
||||
#define GETXXKEY_R_PARSER __parsepwent
|
||||
#define GETXXKEY_R_ENTTYPE struct passwd
|
||||
#define GETXXKEY_R_TEST(ENT) ((ENT)->pw_uid == key)
|
||||
#define DO_GETXXKEY_R_KEYTYPE uid_t
|
||||
@ -260,7 +260,7 @@ int sgetspent_r(const char *string, struct spwd *result_buf,
|
||||
|
||||
#ifdef L_getgrgid_r
|
||||
#define GETXXKEY_R_FUNC getgrgid_r
|
||||
#define GETXXKEY_R_PARSER __parsegrent
|
||||
#define GETXXKEY_R_PARSER __parsegrent
|
||||
#define GETXXKEY_R_ENTTYPE struct group
|
||||
#define GETXXKEY_R_TEST(ENT) ((ENT)->gr_gid == key)
|
||||
#define DO_GETXXKEY_R_KEYTYPE gid_t
|
||||
@ -755,11 +755,11 @@ int putgrent(const struct group *__restrict p, FILE *__restrict f)
|
||||
|
||||
static const unsigned char _sp_off[] = {
|
||||
offsetof(struct spwd, sp_lstchg), /* 2 - not a char ptr */
|
||||
offsetof(struct spwd, sp_min), /* 3 - not a char ptr */
|
||||
offsetof(struct spwd, sp_min), /* 3 - not a char ptr */
|
||||
offsetof(struct spwd, sp_max), /* 4 - not a char ptr */
|
||||
offsetof(struct spwd, sp_warn), /* 5 - not a char ptr */
|
||||
offsetof(struct spwd, sp_inact), /* 6 - not a char ptr */
|
||||
offsetof(struct spwd, sp_expire), /* 7 - not a char ptr */
|
||||
offsetof(struct spwd, sp_warn), /* 5 - not a char ptr */
|
||||
offsetof(struct spwd, sp_inact), /* 6 - not a char ptr */
|
||||
offsetof(struct spwd, sp_expire), /* 7 - not a char ptr */
|
||||
};
|
||||
|
||||
int putspent(const struct spwd *p, FILE *stream)
|
||||
@ -801,18 +801,18 @@ DO_UNLOCK:
|
||||
|
||||
#endif
|
||||
/**********************************************************************/
|
||||
/* Internal uClibc functions. */
|
||||
/* Internal uClibc functions. */
|
||||
/**********************************************************************/
|
||||
#ifdef L___parsepwent
|
||||
|
||||
static const unsigned char pw_off[] = {
|
||||
offsetof(struct passwd, pw_name), /* 0 */
|
||||
offsetof(struct passwd, pw_name), /* 0 */
|
||||
offsetof(struct passwd, pw_passwd), /* 1 */
|
||||
offsetof(struct passwd, pw_uid), /* 2 - not a char ptr */
|
||||
offsetof(struct passwd, pw_gid), /* 3 - not a char ptr */
|
||||
offsetof(struct passwd, pw_gid), /* 3 - not a char ptr */
|
||||
offsetof(struct passwd, pw_gecos), /* 4 */
|
||||
offsetof(struct passwd, pw_dir), /* 5 */
|
||||
offsetof(struct passwd, pw_shell) /* 6 */
|
||||
offsetof(struct passwd, pw_dir), /* 5 */
|
||||
offsetof(struct passwd, pw_shell) /* 6 */
|
||||
};
|
||||
|
||||
int __parsepwent(void *data, char *line)
|
||||
@ -825,7 +825,7 @@ int __parsepwent(void *data, char *line)
|
||||
do {
|
||||
p = ((char *) ((struct passwd *) data)) + pw_off[i];
|
||||
|
||||
if ((i & 6) ^ 2) { /* i!=2 and i!=3 */
|
||||
if ((i & 6) ^ 2) { /* i!=2 and i!=3 */
|
||||
*((char **) p) = line;
|
||||
if (i==6) {
|
||||
return 0;
|
||||
@ -865,7 +865,7 @@ int __parsepwent(void *data, char *line)
|
||||
#ifdef L___parsegrent
|
||||
|
||||
static const unsigned char gr_off[] = {
|
||||
offsetof(struct group, gr_name), /* 0 */
|
||||
offsetof(struct group, gr_name), /* 0 */
|
||||
offsetof(struct group, gr_passwd), /* 1 */
|
||||
offsetof(struct group, gr_gid) /* 2 - not a char ptr */
|
||||
};
|
||||
@ -966,12 +966,12 @@ static const unsigned char sp_off[] = {
|
||||
offsetof(struct spwd, sp_namp), /* 0 */
|
||||
offsetof(struct spwd, sp_pwdp), /* 1 */
|
||||
offsetof(struct spwd, sp_lstchg), /* 2 - not a char ptr */
|
||||
offsetof(struct spwd, sp_min), /* 3 - not a char ptr */
|
||||
offsetof(struct spwd, sp_min), /* 3 - not a char ptr */
|
||||
offsetof(struct spwd, sp_max), /* 4 - not a char ptr */
|
||||
offsetof(struct spwd, sp_warn), /* 5 - not a char ptr */
|
||||
offsetof(struct spwd, sp_inact), /* 6 - not a char ptr */
|
||||
offsetof(struct spwd, sp_expire), /* 7 - not a char ptr */
|
||||
offsetof(struct spwd, sp_flag) /* 8 - not a char ptr */
|
||||
offsetof(struct spwd, sp_warn), /* 5 - not a char ptr */
|
||||
offsetof(struct spwd, sp_inact), /* 6 - not a char ptr */
|
||||
offsetof(struct spwd, sp_expire), /* 7 - not a char ptr */
|
||||
offsetof(struct spwd, sp_flag) /* 8 - not a char ptr */
|
||||
};
|
||||
|
||||
int __parsespent(void *data, char * line)
|
||||
|
@ -244,7 +244,7 @@ int adduser_main(int argc, char **argv)
|
||||
const char *gecos = default_gecos;
|
||||
const char *home = NULL;
|
||||
const char *shell = DEFAULT_SHELL;
|
||||
const char *usegroup = NULL;
|
||||
const char *usegroup = NULL;
|
||||
int flags;
|
||||
int setpass = 1;
|
||||
int makehome = 1;
|
||||
|
@ -101,7 +101,7 @@ extern int login_main(int argc, char **argv)
|
||||
if ( optarg != argv[optind-1] )
|
||||
bb_show_usage( );
|
||||
|
||||
if ( !amroot ) /* Auth bypass only if real UID is zero */
|
||||
if ( !amroot ) /* Auth bypass only if real UID is zero */
|
||||
bb_error_msg_and_die ( "-f permission denied" );
|
||||
|
||||
safe_strncpy(username, optarg, USERNAME_SIZE);
|
||||
|
@ -121,7 +121,7 @@ struct devfsd_notify_struct
|
||||
#define BUFFER_SIZE 16384
|
||||
#define DEVFSD_VERSION "1.3.25"
|
||||
#define CONFIG_FILE "/etc/devfsd.conf"
|
||||
#define MODPROBE "/sbin/modprobe"
|
||||
#define MODPROBE "/sbin/modprobe"
|
||||
#define MODPROBE_SWITCH_1 "-k"
|
||||
#define MODPROBE_SWITCH_2 "-C"
|
||||
#define CONFIG_MODULES_DEVFS "/etc/modules.devfs"
|
||||
@ -289,7 +289,7 @@ static struct event_type
|
||||
/* Busybox messages */
|
||||
|
||||
static const char * const bb_msg_proto_rev = "protocol revision";
|
||||
static const char * const bb_msg_bad_config = "bad %s config file: %s";
|
||||
static const char * const bb_msg_bad_config = "bad %s config file: %s";
|
||||
static const char * const bb_msg_small_buffer = "buffer too small";
|
||||
static const char * const bb_msg_variable_not_found = "variable: %s not found";
|
||||
|
||||
@ -306,7 +306,7 @@ static void msg_logger(int pri, const char * fmt, ... )
|
||||
vsyslog( pri , fmt, ap);
|
||||
/* Man: A trailing newline is added when needed. */
|
||||
closelog();
|
||||
}
|
||||
}
|
||||
/* ENABLE_DEVFSD_VERBOSE is always enabled if msg_logger is used */
|
||||
if ((ENABLE_DEVFSD_VERBOSE && ret) || ENABLE_DEBUG) {
|
||||
bb_error_msg(fmt, ap);
|
||||
@ -319,7 +319,7 @@ static void msg_logger_and_die(int pri, const char* fmt, ...)
|
||||
va_list ap;
|
||||
|
||||
va_start(ap, fmt);
|
||||
msg_logger(pri, fmt, ap);
|
||||
msg_logger(pri, fmt, ap);
|
||||
va_end(ap);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
@ -506,7 +506,7 @@ int devfsd_main (int argc, char **argv)
|
||||
|
||||
bb_printf("%s v%s started for %s\n",bb_applet_name, DEVFSD_VERSION, mount_point);
|
||||
|
||||
/* Set umask so that mknod(2), open(2) and mkdir(2) have complete control over permissions */
|
||||
/* Set umask so that mknod(2), open(2) and mkdir(2) have complete control over permissions */
|
||||
umask (0);
|
||||
read_config_file (CONFIG_FILE, FALSE, &event_mask);
|
||||
/* Do the scan before forking, so that boot scripts see the finished product */
|
||||
@ -691,7 +691,7 @@ static void process_config_line (const char *line, unsigned long *event_mask)
|
||||
the device name) to the module loading facility. In addition,
|
||||
the /etc/modules.devfs configuration file is used.*/
|
||||
if (ENABLE_DEVFSD_MODLOAD)
|
||||
new->action.what = AC_MODLOAD;
|
||||
new->action.what = AC_MODLOAD;
|
||||
break;
|
||||
case 6: /* EXECUTE */
|
||||
new->action.what = AC_EXECUTE;
|
||||
@ -928,7 +928,7 @@ static void action_execute (const struct devfsd_notify_struct *info,
|
||||
|
||||
static void action_copy (const struct devfsd_notify_struct *info,
|
||||
const struct config_entry_struct *entry,
|
||||
const regmatch_t *regexpr, unsigned int numexpr)
|
||||
const regmatch_t *regexpr, unsigned int numexpr)
|
||||
/* [SUMMARY] Copy permissions.
|
||||
<info> The devfs change.
|
||||
<entry> The config file entry.
|
||||
@ -1126,7 +1126,7 @@ static int copy_inode (const char *destpath, const struct stat *dest_stat,
|
||||
( dest_len = readlink (destpath , dest_link , STRING_LENGTH - 1) ) < 0 )
|
||||
return (FALSE);
|
||||
source_link[source_len] = '\0';
|
||||
dest_link[dest_len] = '\0';
|
||||
dest_link[dest_len] = '\0';
|
||||
if ( (source_len != dest_len) || (strcmp (source_link, dest_link) != 0) )
|
||||
{
|
||||
unlink (destpath);
|
||||
@ -1442,9 +1442,9 @@ static int make_dir_tree (const char *path)
|
||||
static int expand_expression(char *output, unsigned int outsize,
|
||||
const char *input,
|
||||
const char *(*get_variable_func)(const char *variable, void *info),
|
||||
void *info,
|
||||
const char *devname,
|
||||
const regmatch_t *ex, unsigned int numexp)
|
||||
void *info,
|
||||
const char *devname,
|
||||
const regmatch_t *ex, unsigned int numexp)
|
||||
/* [SUMMARY] Expand environment variables and regular subexpressions in string.
|
||||
<output> The output expanded expression is written here.
|
||||
<length> The size of the output buffer.
|
||||
@ -1692,7 +1692,7 @@ static char get_old_ide_name (unsigned int major, unsigned int minor)
|
||||
*/
|
||||
{
|
||||
char letter='y'; /* 121 */
|
||||
char c='a'; /* 97 */
|
||||
char c='a'; /* 97 */
|
||||
int i=IDE0_MAJOR;
|
||||
|
||||
debug_msg_logger(LOG_INFO, __FUNCTION__);
|
||||
|
@ -74,8 +74,8 @@
|
||||
#define RW_LONG 22 /* extra bytes in R/W LONG cmd ( < ATA-4)*/
|
||||
#define START_FW_REV 23 /* ASCII firmware revision */
|
||||
#define LENGTH_FW_REV 4 /* 4 words (8 bytes or characters) */
|
||||
#define START_MODEL 27 /* ASCII model number */
|
||||
#define LENGTH_MODEL 20 /* 20 words (40 bytes or characters) */
|
||||
#define START_MODEL 27 /* ASCII model number */
|
||||
#define LENGTH_MODEL 20 /* 20 words (40 bytes or characters) */
|
||||
#define SECTOR_XFER_MAX 47 /* r/w multiple: max sectors xfered */
|
||||
#define DWORD_IO 48 /* can do double-word IO (ATA-1 only) */
|
||||
#define CAPAB_0 49 /* capabilities */
|
||||
@ -121,12 +121,12 @@
|
||||
in low byte, 0x40 in high byte. */
|
||||
#define PSWD_CODE 92 /* master password revision code */
|
||||
#define HWRST_RSLT 93 /* hardware reset result */
|
||||
#define ACOUSTIC 94 /* acoustic mgmt values ( >= ATA-6) */
|
||||
#define ACOUSTIC 94 /* acoustic mgmt values ( >= ATA-6) */
|
||||
#define LBA_LSB 100 /* LBA: maximum. Currently only 48 */
|
||||
#define LBA_MID 101 /* bits are used, but addr 103 */
|
||||
#define LBA_48_MSB 102 /* has been reserved for LBA in */
|
||||
#define LBA_64_MSB 103 /* the future. */
|
||||
#define RM_STAT 127 /* removable media status notification feature set support */
|
||||
#define RM_STAT 127 /* removable media status notification feature set support */
|
||||
#define SECU_STATUS 128 /* security status */
|
||||
#define CFA_PWR_MODE 160 /* CFA power mode 1 */
|
||||
#define START_MEDIA 176 /* media serial number */
|
||||
@ -229,7 +229,7 @@ static const char * const ata1_cfg_str[] = { /* word 0 in ATA-1 mode */
|
||||
*/
|
||||
#define STBY_NID_VAL 0x37c8 /* (a) and (b) */
|
||||
#define STBY_ID_VAL 0x738c /* (a) and not (b) */
|
||||
#define PWRD_NID_VAL 0x8c73 /* not (a) and (b) */
|
||||
#define PWRD_NID_VAL 0x8c73 /* not (a) and (b) */
|
||||
#define PWRD_ID_VAL 0xc837 /* not (a) and not (b) */
|
||||
|
||||
/* words 47 & 59: sector_xfer_max & sector_xfer_cur */
|
||||
@ -237,7 +237,7 @@ static const char * const ata1_cfg_str[] = { /* word 0 in ATA-1 mode */
|
||||
#define MULTIPLE_SETTING_VALID 0x0100 /* 1=multiple sector setting is valid */
|
||||
|
||||
/* word 49: capabilities 0 */
|
||||
#define STD_STBY 0x2000 /* 1=standard values supported (ATA);
|
||||
#define STD_STBY 0x2000 /* 1=standard values supported (ATA);
|
||||
0=vendor specific values */
|
||||
#define IORDY_SUP 0x0800 /* 1=support; 0=may be supported */
|
||||
#define IORDY_OFF 0x0400 /* 1=may be disabled */
|
||||
@ -255,7 +255,7 @@ static const char * const ata1_cfg_str[] = { /* word 0 in ATA-1 mode */
|
||||
#define MODE 0xff00 /* the mode is in the MSBs */
|
||||
|
||||
/* word 53: whats_valid */
|
||||
#define OK_W88 0x0004 /* the ultra_dma info is valid */
|
||||
#define OK_W88 0x0004 /* the ultra_dma info is valid */
|
||||
#define OK_W64_70 0x0002 /* see above for word descriptions */
|
||||
#define OK_W54_58 0x0001 /* current cyl, head, sector, cap. info valid */
|
||||
|
||||
@ -314,25 +314,25 @@ static const char * const minor_str[] = { /* word 81 value: */
|
||||
#endif
|
||||
static const char actual_ver[] = {
|
||||
/* word 81 value: */
|
||||
0, /* 0x0000 WARNING: */
|
||||
1, /* 0x0001 WARNING: */
|
||||
1, /* 0x0002 WARNING: */
|
||||
1, /* 0x0003 WARNING: */
|
||||
2, /* 0x0004 WARNING: This array */
|
||||
2, /* 0x0005 WARNING: corresponds */
|
||||
0, /* 0x0000 WARNING: */
|
||||
1, /* 0x0001 WARNING: */
|
||||
1, /* 0x0002 WARNING: */
|
||||
1, /* 0x0003 WARNING: */
|
||||
2, /* 0x0004 WARNING: This array */
|
||||
2, /* 0x0005 WARNING: corresponds */
|
||||
3, /* 0x0006 WARNING: *exactly* */
|
||||
2, /* 0x0007 WARNING: to the ATA/ */
|
||||
3, /* 0x0008 WARNING: ATAPI version */
|
||||
2, /* 0x0009 WARNING: listed in */
|
||||
3, /* 0x000a WARNING: the */
|
||||
3, /* 0x000b WARNING: minor_str */
|
||||
2, /* 0x0009 WARNING: listed in */
|
||||
3, /* 0x000a WARNING: the */
|
||||
3, /* 0x000b WARNING: minor_str */
|
||||
3, /* 0x000c WARNING: array */
|
||||
4, /* 0x000d WARNING: above. */
|
||||
4, /* 0x000e WARNING: */
|
||||
4, /* 0x000f WARNING: if you change */
|
||||
4, /* 0x0010 WARNING: that one, */
|
||||
4, /* 0x000e WARNING: */
|
||||
4, /* 0x000f WARNING: if you change */
|
||||
4, /* 0x0010 WARNING: that one, */
|
||||
4, /* 0x0011 WARNING: change this one */
|
||||
4, /* 0x0012 WARNING: too!!! */
|
||||
4, /* 0x0012 WARNING: too!!! */
|
||||
5, /* 0x0013 WARNING: */
|
||||
4, /* 0x0014 WARNING: */
|
||||
5, /* 0x0015 WARNING: */
|
||||
@ -343,7 +343,7 @@ static const char actual_ver[] = {
|
||||
0, /* 0x001a WARNING: */
|
||||
6, /* 0x001b WARNING: */
|
||||
6, /* 0x001c WARNING: */
|
||||
0 /* 0x001d-0xfffe */
|
||||
0 /* 0x001d-0xfffe */
|
||||
};
|
||||
|
||||
/* words 82-84: cmds/feats supported */
|
||||
@ -387,7 +387,7 @@ static const char * const cmd_feat_str[] = {
|
||||
"Adv. Power Management feature set",/* word 83 bit 3 */
|
||||
"CFA feature set", /* word 83 bit 2 */
|
||||
"READ/WRITE DMA QUEUED", /* word 83 bit 1 */
|
||||
"DOWNLOAD MICROCODE cmd", /* word 83 bit 0 */
|
||||
"DOWNLOAD MICROCODE cmd", /* word 83 bit 0 */
|
||||
/* --------------*/
|
||||
"", /* word 84 bit 15: !valid bit */
|
||||
"", /* word 84 bit 14: valid bit */
|
||||
@ -428,7 +428,7 @@ static const char * const cmd_feat_str[] = {
|
||||
#define CSEL_VAL 0x0004 /* device num determined by CSEL_VAL */
|
||||
|
||||
/* word 127: removable media status notification feature set support */
|
||||
#define RM_STAT_BITS 0x0003
|
||||
#define RM_STAT_BITS 0x0003
|
||||
#define RM_STAT_SUP 0x0001
|
||||
|
||||
/* word 128: security */
|
||||
@ -774,7 +774,7 @@ static void identify (uint16_t *id_supplied, const char *devname)
|
||||
like_std = 6;
|
||||
}
|
||||
else if(((std == 4) || (!std && (like_std < 5))) &&
|
||||
((((val[INTEGRITY] & SIG) == SIG_VAL) && !chksum) ||
|
||||
((((val[INTEGRITY] & SIG) == SIG_VAL) && !chksum) ||
|
||||
(( val[HWRST_RSLT] & VALID) == VALID_VAL) ||
|
||||
((( val[CMDS_SUPP_1] & VALID) == VALID_VAL) &&
|
||||
(( val[CMDS_SUPP_1] & CMDS_W83) > 0x001f)) ) )
|
||||
@ -805,14 +805,14 @@ static void identify (uint16_t *id_supplied, const char *devname)
|
||||
if(!std)
|
||||
printf("\n\tLikely used: %u\n",like_std);
|
||||
else if(like_std > std)
|
||||
printf("& some of %u\n",like_std);
|
||||
printf("& some of %u\n",like_std);
|
||||
else
|
||||
printf("\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
/* TBD: do CDROM stuff more thoroughly. For now... */
|
||||
kk = 0;
|
||||
kk = 0;
|
||||
if(val[CDR_MINOR] == 9)
|
||||
{
|
||||
kk = 1;
|
||||
@ -886,7 +886,7 @@ static void identify (uint16_t *id_supplied, const char *devname)
|
||||
ll = (uint32_t)val[LBA_SECTS_MSB] << 16 | val[LBA_SECTS_LSB];
|
||||
mm = 0; bbbig = 0;
|
||||
if ( (ll > 0x00FBFC10) && (!val[LCYLS]))
|
||||
printf("\tCHS addressing not supported\n");
|
||||
printf("\tCHS addressing not supported\n");
|
||||
else
|
||||
{
|
||||
jj = val[WHATS_VALID] & OK_W54_58;
|
||||
@ -915,9 +915,9 @@ static void identify (uint16_t *id_supplied, const char *devname)
|
||||
if( ((val[CMDS_SUPP_1] & VALID) == VALID_VAL) &&
|
||||
(val[CMDS_SUPP_1] & SUPPORT_48_BIT) )
|
||||
{
|
||||
bbbig = (__u64)val[LBA_64_MSB] << 48 |
|
||||
(__u64)val[LBA_48_MSB] << 32 |
|
||||
(__u64)val[LBA_MID] << 16 |
|
||||
bbbig = (__u64)val[LBA_64_MSB] << 48 |
|
||||
(__u64)val[LBA_48_MSB] << 32 |
|
||||
(__u64)val[LBA_MID] << 16 |
|
||||
val[LBA_LSB] ;
|
||||
printf("\tLBA48 user addressable sectors:%11llu\n",bbbig);
|
||||
}
|
||||
@ -1081,7 +1081,7 @@ static void identify (uint16_t *id_supplied, const char *devname)
|
||||
|
||||
/* Programmed IO stuff */
|
||||
printf("\tPIO: ");
|
||||
/* If a drive supports mode n (e.g. 3), it also supports all modes less
|
||||
/* If a drive supports mode n (e.g. 3), it also supports all modes less
|
||||
* than n (e.g. 3, 2, 1 and 0). Print all the modes. */
|
||||
if((val[WHATS_VALID] & OK_W64_70) && (val[ADV_PIO_MODES] & PIO_SUP))
|
||||
{
|
||||
@ -1349,8 +1349,8 @@ static void dump_identity (const struct hd_driveid *id)
|
||||
capacity = (id->cur_capacity1 << 16) | id->cur_capacity0;
|
||||
#endif
|
||||
printf(" CurCHS=%u/%u/%u, CurSects=%lu, LBA=%s",id->cur_cyls, id->cur_heads,
|
||||
id->cur_sectors, capacity ,
|
||||
((id->capability&2)==0)?"no":"yes");
|
||||
id->cur_sectors, capacity ,
|
||||
((id->capability&2)==0)?"no":"yes");
|
||||
|
||||
if_printf((id->capability&2),", LBAsects=%u", id->lba_capacity);
|
||||
|
||||
@ -1363,7 +1363,7 @@ static void dump_identity (const struct hd_driveid *id)
|
||||
if_strcat((id->dma_1word & 0x200), dmodes, "*");
|
||||
if_strcat((id->dma_1word & 2), dmodes, "sdma1 ");
|
||||
if_strcat((id->dma_1word & 0x400), dmodes, "*");
|
||||
if_strcat((id->dma_1word & 4), dmodes, "sdma2 ");
|
||||
if_strcat((id->dma_1word & 4), dmodes, "sdma2 ");
|
||||
if_strcat((id->dma_1word & 0xf800), dmodes, "*");
|
||||
if_strcat((id->dma_1word & 0xf8), dmodes, "sdma? ");
|
||||
if_strcat((id->dma_mword & 0x100), dmodes, "*");
|
||||
@ -2346,7 +2346,7 @@ static void process_dev (char *devname)
|
||||
no_scsi();
|
||||
if (ioctl(fd, HDIO_DRIVE_CMD, &args)
|
||||
&& (args[0] = WIN_CHECKPOWERMODE2) /* try again with 0x98 */
|
||||
&& ioctl(fd, HDIO_DRIVE_CMD, &args))
|
||||
&& ioctl(fd, HDIO_DRIVE_CMD, &args))
|
||||
{
|
||||
if (errno != EIO || args[0] != 0 || args[1] != 0)
|
||||
state = "unknown";
|
||||
@ -2456,7 +2456,7 @@ identify_abort:
|
||||
|
||||
|
||||
if (do_ctimings)
|
||||
do_time(0,fd); /*time cache */
|
||||
do_time(0,fd); /*time cache */
|
||||
if (do_timings)
|
||||
do_time(1,fd); /*time device */
|
||||
if (do_flush)
|
||||
|
@ -295,7 +295,7 @@ extern int insmod_ng_main( int argc, char **argv);
|
||||
#define CONFIG_PLT_ENTRY_SIZE 8
|
||||
#define CONFIG_USE_SINGLE
|
||||
#ifndef EM_CYGNUS_V850 /* grumble */
|
||||
#define EM_CYGNUS_V850 0x9080
|
||||
#define EM_CYGNUS_V850 0x9080
|
||||
#endif
|
||||
#define SYMBOL_PREFIX "_"
|
||||
#endif
|
||||
@ -695,7 +695,7 @@ static int obj_gpl_license(struct obj_file *f, const char **license);
|
||||
#ifdef SYMBOL_PREFIX
|
||||
#define SPFX SYMBOL_PREFIX
|
||||
#else
|
||||
#define SPFX ""
|
||||
#define SPFX ""
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -14,46 +14,46 @@
|
||||
/* full usage according Donald Becker
|
||||
* usage: ether-wake [-i <ifname>] [-p aa:bb:cc:dd[:ee:ff]] 00:11:22:33:44:55\n"
|
||||
*
|
||||
* This program generates and transmits a Wake-On-LAN (WOL)\n"
|
||||
* \"Magic Packet\", used for restarting machines that have been\n"
|
||||
* soft-powered-down (ACPI D3-warm state).\n"
|
||||
* It currently generates the standard AMD Magic Packet format, with\n"
|
||||
* an optional password appended.\n"
|
||||
* This program generates and transmits a Wake-On-LAN (WOL)\n"
|
||||
* \"Magic Packet\", used for restarting machines that have been\n"
|
||||
* soft-powered-down (ACPI D3-warm state).\n"
|
||||
* It currently generates the standard AMD Magic Packet format, with\n"
|
||||
* an optional password appended.\n"
|
||||
*
|
||||
* The single required parameter is the Ethernet MAC (station) address\n"
|
||||
* of the machine to wake or a host ID with known NSS 'ethers' entry.\n"
|
||||
* The MAC address may be found with the 'arp' program while the target\n"
|
||||
* machine is awake.\n"
|
||||
* The single required parameter is the Ethernet MAC (station) address\n"
|
||||
* of the machine to wake or a host ID with known NSS 'ethers' entry.\n"
|
||||
* The MAC address may be found with the 'arp' program while the target\n"
|
||||
* machine is awake.\n"
|
||||
*
|
||||
* Options:\n"
|
||||
* -b Send wake-up packet to the broadcast address.\n"
|
||||
* -D Increase the debug level.\n"
|
||||
* -i ifname Use interface IFNAME instead of the default 'eth0'.\n"
|
||||
* -p <pw> Append the four or six byte password PW to the packet.\n"
|
||||
* A password is only required for a few adapter types.\n"
|
||||
* The password may be specified in ethernet hex format\n"
|
||||
* or dotted decimal (Internet address)\n"
|
||||
* -p 00:22:44:66:88:aa\n"
|
||||
* -p 192.168.1.1\n";
|
||||
* Options:\n"
|
||||
* -b Send wake-up packet to the broadcast address.\n"
|
||||
* -D Increase the debug level.\n"
|
||||
* -i ifname Use interface IFNAME instead of the default 'eth0'.\n"
|
||||
* -p <pw> Append the four or six byte password PW to the packet.\n"
|
||||
* A password is only required for a few adapter types.\n"
|
||||
* The password may be specified in ethernet hex format\n"
|
||||
* or dotted decimal (Internet address)\n"
|
||||
* -p 00:22:44:66:88:aa\n"
|
||||
* -p 192.168.1.1\n";
|
||||
*
|
||||
*
|
||||
* This program generates and transmits a Wake-On-LAN (WOL) "Magic Packet",
|
||||
* used for restarting machines that have been soft-powered-down
|
||||
* (ACPI D3-warm state). It currently generates the standard AMD Magic Packet
|
||||
* format, with an optional password appended.
|
||||
* This program generates and transmits a Wake-On-LAN (WOL) "Magic Packet",
|
||||
* used for restarting machines that have been soft-powered-down
|
||||
* (ACPI D3-warm state). It currently generates the standard AMD Magic Packet
|
||||
* format, with an optional password appended.
|
||||
*
|
||||
* This software may be used and distributed according to the terms
|
||||
* of the GNU Public License, incorporated herein by reference.
|
||||
* Contact the author for use under other terms.
|
||||
* This software may be used and distributed according to the terms
|
||||
* of the GNU Public License, incorporated herein by reference.
|
||||
* Contact the author for use under other terms.
|
||||
*
|
||||
* This source file was originally part of the network tricks package, and
|
||||
* is now distributed to support the Scyld Beowulf system.
|
||||
* Copyright 1999-2003 Donald Becker and Scyld Computing Corporation.
|
||||
* This source file was originally part of the network tricks package, and
|
||||
* is now distributed to support the Scyld Beowulf system.
|
||||
* Copyright 1999-2003 Donald Becker and Scyld Computing Corporation.
|
||||
*
|
||||
* The author may be reached as becker@scyld, or C/O
|
||||
* Scyld Computing Corporation
|
||||
* 914 Bay Ridge Road, Suite 220
|
||||
* Annapolis MD 21403
|
||||
* The author may be reached as becker@scyld, or C/O
|
||||
* Scyld Computing Corporation
|
||||
* 914 Bay Ridge Road, Suite 220
|
||||
* Annapolis MD 21403
|
||||
*
|
||||
* Notes:
|
||||
* On some systems dropping root capability allows the process to be
|
||||
|
@ -77,8 +77,8 @@ int hostname_main(int argc, char **argv)
|
||||
if (argc < 1)
|
||||
bb_show_usage();
|
||||
|
||||
while ((opt = getopt(argc, argv, "dfisF:")) > 0) {
|
||||
switch (opt) {
|
||||
while ((opt = getopt(argc, argv, "dfisF:")) > 0) {
|
||||
switch (opt) {
|
||||
case 'd':
|
||||
case 'f':
|
||||
case 'i':
|
||||
|
@ -471,8 +471,8 @@ static int static_up(struct interface_defn_t *ifd, execfn *exec)
|
||||
return ((result == 3) ? 3 : 0);
|
||||
#else
|
||||
result = execute("ifconfig %iface% %address% netmask %netmask% "
|
||||
"[[broadcast %broadcast%]] [[pointopoint %pointopoint%]] "
|
||||
"[[media %media%]] [[mtu %mtu%]] [[hw %hwaddress%]] up",
|
||||
"[[broadcast %broadcast%]] [[pointopoint %pointopoint%]] "
|
||||
"[[media %media%]] [[mtu %mtu%]] [[hw %hwaddress%]] up",
|
||||
ifd, exec);
|
||||
result += execute("[[ route add default gw %gateway% %iface% ]]", ifd, exec);
|
||||
return ((result == 2) ? 2 : 0);
|
||||
|
@ -1039,9 +1039,9 @@ static char *get_name(char *name, char *p)
|
||||
* args. */
|
||||
|
||||
/* static const char * const ss_fmt[] = { */
|
||||
/* "%Ln%Lu%lu%lu%lu%lu%ln%ln%Ln%Lu%lu%lu%lu%lu%lu", */
|
||||
/* "%Lu%Lu%lu%lu%lu%lu%ln%ln%Lu%Lu%lu%lu%lu%lu%lu", */
|
||||
/* "%Lu%Lu%lu%lu%lu%lu%lu%lu%Lu%Lu%lu%lu%lu%lu%lu%lu" */
|
||||
/* "%Ln%Lu%lu%lu%lu%lu%ln%ln%Ln%Lu%lu%lu%lu%lu%lu", */
|
||||
/* "%Lu%Lu%lu%lu%lu%lu%ln%ln%Lu%Lu%lu%lu%lu%lu%lu", */
|
||||
/* "%Lu%Lu%lu%lu%lu%lu%lu%lu%Lu%Lu%lu%lu%lu%lu%lu%lu" */
|
||||
/* }; */
|
||||
|
||||
/* Lie about the size of the int pointed to for %n. */
|
||||
|
@ -54,8 +54,8 @@ static void print_link_flags(FILE *fp, unsigned flags, unsigned mdown)
|
||||
fprintf(fp, "<");
|
||||
flags &= ~IFF_RUNNING;
|
||||
#define _PF(f) if (flags&IFF_##f) { \
|
||||
flags &= ~IFF_##f ; \
|
||||
fprintf(fp, #f "%s", flags ? "," : ""); }
|
||||
flags &= ~IFF_##f ; \
|
||||
fprintf(fp, #f "%s", flags ? "," : ""); }
|
||||
_PF(LOOPBACK);
|
||||
_PF(BROADCAST);
|
||||
_PF(POINTOPOINT);
|
||||
@ -74,7 +74,7 @@ static void print_link_flags(FILE *fp, unsigned flags, unsigned mdown)
|
||||
#endif
|
||||
_PF(UP);
|
||||
#undef _PF
|
||||
if (flags)
|
||||
if (flags)
|
||||
fprintf(fp, "%x", flags);
|
||||
if (mdown)
|
||||
fprintf(fp, ",M-DOWN");
|
||||
@ -636,9 +636,9 @@ static int ipaddr_modify(int cmd, int argc, char **argv)
|
||||
"anycast", "scope", "dev", "label", "local", 0 };
|
||||
struct rtnl_handle rth;
|
||||
struct {
|
||||
struct nlmsghdr n;
|
||||
struct ifaddrmsg ifa;
|
||||
char buf[256];
|
||||
struct nlmsghdr n;
|
||||
struct ifaddrmsg ifa;
|
||||
char buf[256];
|
||||
} req;
|
||||
char *d = NULL;
|
||||
char *l = NULL;
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user