summaryrefslogtreecommitdiff
path: root/libbb
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2011-01-04 19:56:11 +0700
committerNguyễn Thái Ngọc Duy <pclouds@gmail.com>2011-01-04 19:56:11 +0700
commit9db69882bee2d528d706d61d34ef7741122330be (patch)
treef46c4ed5cae58956cd165e552ea4e366fd9b1a6c /libbb
parent3f357a9c754805c4c38793749927aeda82797735 (diff)
parente4dcba1c103dc28e927e004791e331aaf604383d (diff)
downloadbusybox-w32-9db69882bee2d528d706d61d34ef7741122330be.tar.gz
busybox-w32-9db69882bee2d528d706d61d34ef7741122330be.tar.bz2
busybox-w32-9db69882bee2d528d706d61d34ef7741122330be.zip
Merge commit 'e4dcba1c103dc28e927e004791e331aaf604383d'
Conflicts: libbb/make_directory.c
Diffstat (limited to 'libbb')
-rw-r--r--libbb/dump.c6
-rw-r--r--libbb/full_write.c2
-rw-r--r--libbb/human_readable.c4
-rw-r--r--libbb/inet_common.c2
-rw-r--r--libbb/inode_hash.c4
-rw-r--r--libbb/login.c2
-rw-r--r--libbb/make_directory.c2
-rw-r--r--libbb/parse_config.c2
-rw-r--r--libbb/parse_mode.c10
-rw-r--r--libbb/progress.c6
-rw-r--r--libbb/speed_table.c4
-rw-r--r--libbb/update_passwd.c2
-rw-r--r--libbb/wfopen_input.c4
-rw-r--r--libbb/xatonum_template.c2
-rw-r--r--libbb/xgetcwd.c2
15 files changed, 27 insertions, 27 deletions
diff --git a/libbb/dump.c b/libbb/dump.c
index 4db3f06f0..1b1d03a66 100644
--- a/libbb/dump.c
+++ b/libbb/dump.c
@@ -4,7 +4,7 @@
4 * based on code from util-linux v 2.11l 4 * based on code from util-linux v 2.11l
5 * 5 *
6 * Copyright (c) 1989 6 * Copyright (c) 1989
7 * The Regents of the University of California. All rights reserved. 7 * The Regents of the University of California. All rights reserved.
8 * 8 *
9 * Licensed under GPLv2 or later, see file LICENSE in this source tree. 9 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
10 * 10 *
@@ -208,7 +208,7 @@ static NOINLINE void rewrite(priv_dumper_t *dumper, FS *fs)
208 pr->bcnt = fu->bcnt; 208 pr->bcnt = fu->bcnt;
209 } else if (sokay == USEPREC) { 209 } else if (sokay == USEPREC) {
210 pr->bcnt = prec; 210 pr->bcnt = prec;
211 } else { /* NOTOKAY */ 211 } else { /* NOTOKAY */
212 bb_error_msg_and_die("%%s requires a precision or a byte count"); 212 bb_error_msg_and_die("%%s requires a precision or a byte count");
213 } 213 }
214 } else if (*p1 == '_') { 214 } else if (*p1 == '_') {
@@ -467,7 +467,7 @@ static void bpad(PR *pr)
467 467
468static const char conv_str[] ALIGN1 = 468static const char conv_str[] ALIGN1 =
469 "\0\\0\0" 469 "\0\\0\0"
470 "\007\\a\0" /* \a */ 470 "\007\\a\0" /* \a */
471 "\b\\b\0" 471 "\b\\b\0"
472 "\f\\b\0" 472 "\f\\b\0"
473 "\n\\n\0" 473 "\n\\n\0"
diff --git a/libbb/full_write.c b/libbb/full_write.c
index a2abaee25..777fbd910 100644
--- a/libbb/full_write.c
+++ b/libbb/full_write.c
@@ -30,7 +30,7 @@ ssize_t FAST_FUNC full_write(int fd, const void *buf, size_t len)
30 /* user can do another write to know the error code */ 30 /* user can do another write to know the error code */
31 return total; 31 return total;
32 } 32 }
33 return cc; /* write() returns -1 on failure. */ 33 return cc; /* write() returns -1 on failure. */
34 } 34 }
35 35
36 total += cc; 36 total += cc;
diff --git a/libbb/human_readable.c b/libbb/human_readable.c
index 50cbe41bb..8b22b0cb5 100644
--- a/libbb/human_readable.c
+++ b/libbb/human_readable.c
@@ -53,8 +53,8 @@ const char* FAST_FUNC make_human_readable_str(unsigned long long val,
53 u = unit_chars; 53 u = unit_chars;
54 54
55 if (display_unit) { 55 if (display_unit) {
56 val += display_unit/2; /* Deal with rounding */ 56 val += display_unit/2; /* Deal with rounding */
57 val /= display_unit; /* Don't combine with the line above! */ 57 val /= display_unit; /* Don't combine with the line above! */
58 /* will just print it as ulonglong (below) */ 58 /* will just print it as ulonglong (below) */
59 } else { 59 } else {
60 while ((val >= 1024) 60 while ((val >= 1024)
diff --git a/libbb/inet_common.c b/libbb/inet_common.c
index e031ddf9b..6f585ebd9 100644
--- a/libbb/inet_common.c
+++ b/libbb/inet_common.c
@@ -218,4 +218,4 @@ char* FAST_FUNC INET6_rresolve(struct sockaddr_in6 *sin6, int numeric)
218 return xstrdup(name); 218 return xstrdup(name);
219} 219}
220 220
221#endif /* CONFIG_FEATURE_IPV6 */ 221#endif /* CONFIG_FEATURE_IPV6 */
diff --git a/libbb/inode_hash.c b/libbb/inode_hash.c
index 2aea08b04..715535ef5 100644
--- a/libbb/inode_hash.c
+++ b/libbb/inode_hash.c
@@ -17,8 +17,8 @@ typedef struct ino_dev_hash_bucket_struct {
17 char name[1]; 17 char name[1];
18} ino_dev_hashtable_bucket_t; 18} ino_dev_hashtable_bucket_t;
19 19
20#define HASH_SIZE 311 /* Should be prime */ 20#define HASH_SIZE 311 /* Should be prime */
21#define hash_inode(i) ((i) % HASH_SIZE) 21#define hash_inode(i) ((i) % HASH_SIZE)
22 22
23/* array of [HASH_SIZE] elements */ 23/* array of [HASH_SIZE] elements */
24static ino_dev_hashtable_bucket_t **ino_dev_hashtable; 24static ino_dev_hashtable_bucket_t **ino_dev_hashtable;
diff --git a/libbb/login.c b/libbb/login.c
index aa2e17164..8a82c6add 100644
--- a/libbb/login.c
+++ b/libbb/login.c
@@ -30,7 +30,7 @@ void FAST_FUNC print_login_issue(const char *issue_file, const char *tty)
30 time(&t); 30 time(&t);
31 uname(&uts); 31 uname(&uts);
32 32
33 puts("\r"); /* start a new line */ 33 puts("\r"); /* start a new line */
34 34
35 fp = fopen_for_read(issue_file); 35 fp = fopen_for_read(issue_file);
36 if (!fp) 36 if (!fp)
diff --git a/libbb/make_directory.c b/libbb/make_directory.c
index 1095b49a3..8057f2cec 100644
--- a/libbb/make_directory.c
+++ b/libbb/make_directory.c
@@ -44,7 +44,7 @@ int FAST_FUNC bb_make_directory(char *path, long mode, int flags)
44 while (1) { 44 while (1) {
45 c = '\0'; 45 c = '\0';
46 46
47 if (flags & FILEUTILS_RECUR) { /* Get the parent */ 47 if (flags & FILEUTILS_RECUR) { /* Get the parent */
48 /* skip drive letter and initial slashes */ 48 /* skip drive letter and initial slashes */
49 if (ENABLE_PLATFORM_MINGW32 && s == path && *s && s[1] == ':') { 49 if (ENABLE_PLATFORM_MINGW32 && s == path && *s && s[1] == ':') {
50 s += 2; 50 s += 2;
diff --git a/libbb/parse_config.c b/libbb/parse_config.c
index 9dbfaf5d7..d471edbee 100644
--- a/libbb/parse_config.c
+++ b/libbb/parse_config.c
@@ -45,7 +45,7 @@ int parse_main(int argc UNUSED_PARAM, char **argv)
45Typical usage: 45Typical usage:
46 46
47----- CUT ----- 47----- CUT -----
48 char *t[3]; // tokens placeholder 48 char *t[3]; // tokens placeholder
49 parser_t *p = config_open(filename); 49 parser_t *p = config_open(filename);
50 if (p) { 50 if (p) {
51 // parse line-by-line 51 // parse line-by-line
diff --git a/libbb/parse_mode.c b/libbb/parse_mode.c
index 8ea89163c..5a4e1c579 100644
--- a/libbb/parse_mode.c
+++ b/libbb/parse_mode.c
@@ -57,8 +57,8 @@ int FAST_FUNC bb_parse_mode(const char *s, mode_t *current_mode)
57 /* Note: we allow empty clauses, and hence empty modes. 57 /* Note: we allow empty clauses, and hence empty modes.
58 * We treat an empty mode as no change to perms. */ 58 * We treat an empty mode as no change to perms. */
59 59
60 while (*s) { /* Process clauses. */ 60 while (*s) { /* Process clauses. */
61 if (*s == ',') { /* We allow empty clauses. */ 61 if (*s == ',') { /* We allow empty clauses. */
62 ++s; 62 ++s;
63 continue; 63 continue;
64 } 64 }
@@ -77,7 +77,7 @@ int FAST_FUNC bb_parse_mode(const char *s, mode_t *current_mode)
77 } 77 }
78 } while (*++p); 78 } while (*++p);
79 79
80 do { /* Process action list. */ 80 do { /* Process action list. */
81 if ((*s != '+') && (*s != '-')) { 81 if ((*s != '+') && (*s != '-')) {
82 if (*s != '=') { 82 if (*s != '=') {
83 return 0; 83 return 0;
@@ -93,7 +93,7 @@ int FAST_FUNC bb_parse_mode(const char *s, mode_t *current_mode)
93 op = *s++; 93 op = *s++;
94 94
95 /* Check for permcopy. */ 95 /* Check for permcopy. */
96 p = who_chars + 1; /* Skip 'a' entry. */ 96 p = who_chars + 1; /* Skip 'a' entry. */
97 do { 97 do {
98 if (*p == *s) { 98 if (*p == *s) {
99 int i = 0; 99 int i = 0;
@@ -128,7 +128,7 @@ int FAST_FUNC bb_parse_mode(const char *s, mode_t *current_mode)
128 } 128 }
129 } while (*++p); 129 } while (*++p);
130 GOT_ACTION: 130 GOT_ACTION:
131 if (permlist) { /* The permlist was nonempty. */ 131 if (permlist) { /* The permlist was nonempty. */
132 mode_t tmp = wholist; 132 mode_t tmp = wholist;
133 if (!wholist) { 133 if (!wholist) {
134 mode_t u_mask = umask(0); 134 mode_t u_mask = umask(0);
diff --git a/libbb/progress.c b/libbb/progress.c
index f53271398..4c2763c53 100644
--- a/libbb/progress.c
+++ b/libbb/progress.c
@@ -7,7 +7,7 @@
7 */ 7 */
8/*- 8/*-
9 * Copyright (c) 1992, 1993 9 * Copyright (c) 1992, 1993
10 * The Regents of the University of California. All rights reserved. 10 * The Regents of the University of California. All rights reserved.
11 * 11 *
12 * Redistribution and use in source and binary forms, with or without 12 * Redistribution and use in source and binary forms, with or without
13 * modification, are permitted provided that the following conditions 13 * modification, are permitted provided that the following conditions
@@ -18,8 +18,8 @@
18 * notice, this list of conditions and the following disclaimer in the 18 * notice, this list of conditions and the following disclaimer in the
19 * documentation and/or other materials provided with the distribution. 19 * documentation and/or other materials provided with the distribution.
20 * 20 *
21 * 3. <BSD Advertising Clause omitted per the July 22, 1999 licensing change 21 * 3. BSD Advertising Clause omitted per the July 22, 1999 licensing change
22 * ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change> 22 * ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change
23 * 23 *
24 * 4. Neither the name of the University nor the names of its contributors 24 * 4. Neither the name of the University nor the names of its contributors
25 * may be used to endorse or promote products derived from this software 25 * may be used to endorse or promote products derived from this software
diff --git a/libbb/speed_table.c b/libbb/speed_table.c
index 6f95c54e6..45159f1f3 100644
--- a/libbb/speed_table.c
+++ b/libbb/speed_table.c
@@ -29,12 +29,12 @@ static const struct speed_map speeds[] = {
29 {B2400, 2400}, 29 {B2400, 2400},
30 {B4800, 4800}, 30 {B4800, 4800},
31 {B9600, 9600}, 31 {B9600, 9600},
32#ifdef B19200 32#ifdef B19200
33 {B19200, 19200}, 33 {B19200, 19200},
34#elif defined(EXTA) 34#elif defined(EXTA)
35 {EXTA, 19200}, 35 {EXTA, 19200},
36#endif 36#endif
37#ifdef B38400 37#ifdef B38400
38 {B38400, 38400/256 + 0x8000U}, 38 {B38400, 38400/256 + 0x8000U},
39#elif defined(EXTB) 39#elif defined(EXTB)
40 {EXTB, 38400/256 + 0x8000U}, 40 {EXTB, 38400/256 + 0x8000U},
diff --git a/libbb/update_passwd.c b/libbb/update_passwd.c
index a2be0f155..dc5029223 100644
--- a/libbb/update_passwd.c
+++ b/libbb/update_passwd.c
@@ -22,7 +22,7 @@ static void check_selinux_update_passwd(const char *username)
22 char *seuser; 22 char *seuser;
23 23
24 if (getuid() != (uid_t)0 || is_selinux_enabled() == 0) 24 if (getuid() != (uid_t)0 || is_selinux_enabled() == 0)
25 return; /* No need to check */ 25 return; /* No need to check */
26 26
27 if (getprevcon_raw(&context) < 0) 27 if (getprevcon_raw(&context) < 0)
28 bb_perror_msg_and_die("getprevcon failed"); 28 bb_perror_msg_and_die("getprevcon failed");
diff --git a/libbb/wfopen_input.c b/libbb/wfopen_input.c
index 422a58ecf..d8b1c4a36 100644
--- a/libbb/wfopen_input.c
+++ b/libbb/wfopen_input.c
@@ -31,7 +31,7 @@ FILE* FAST_FUNC xfopen_stdin(const char *filename)
31 FILE *fp = fopen_or_warn_stdin(filename); 31 FILE *fp = fopen_or_warn_stdin(filename);
32 if (fp) 32 if (fp)
33 return fp; 33 return fp;
34 xfunc_die(); /* We already output an error message. */ 34 xfunc_die(); /* We already output an error message. */
35} 35}
36 36
37int FAST_FUNC open_or_warn_stdin(const char *filename) 37int FAST_FUNC open_or_warn_stdin(const char *filename)
@@ -52,5 +52,5 @@ int FAST_FUNC xopen_stdin(const char *filename)
52 int fd = open_or_warn_stdin(filename); 52 int fd = open_or_warn_stdin(filename);
53 if (fd >= 0) 53 if (fd >= 0)
54 return fd; 54 return fd;
55 xfunc_die(); /* We already output an error message. */ 55 xfunc_die(); /* We already output an error message. */
56} 56}
diff --git a/libbb/xatonum_template.c b/libbb/xatonum_template.c
index f67b50710..029f66202 100644
--- a/libbb/xatonum_template.c
+++ b/libbb/xatonum_template.c
@@ -41,7 +41,7 @@ unsigned type FAST_FUNC xstrtou(_range_sfx)(const char *numstr, int base,
41 if (errno || numstr == e) 41 if (errno || numstr == e)
42 goto inval; /* error / no digits / illegal trailing chars */ 42 goto inval; /* error / no digits / illegal trailing chars */
43 43
44 errno = old_errno; /* Ok. So restore errno. */ 44 errno = old_errno; /* Ok. So restore errno. */
45 45
46 /* Do optional suffix parsing. Allow 'empty' suffix tables. 46 /* Do optional suffix parsing. Allow 'empty' suffix tables.
47 * Note that we also allow nul suffixes with associated multipliers, 47 * Note that we also allow nul suffixes with associated multipliers,
diff --git a/libbb/xgetcwd.c b/libbb/xgetcwd.c
index 97367217e..71720d323 100644
--- a/libbb/xgetcwd.c
+++ b/libbb/xgetcwd.c
@@ -24,7 +24,7 @@ xrealloc_getcwd_or_warn(char *cwd)
24 char *ret; 24 char *ret;
25 unsigned path_max; 25 unsigned path_max;
26 26
27 path_max = 128; /* 128 + 64 should be enough for 99% of cases */ 27 path_max = 128; /* 128 + 64 should be enough for 99% of cases */
28 28
29 while (1) { 29 while (1) {
30 path_max += PATH_INCR; 30 path_max += PATH_INCR;