diff options
| author | Denis Vlasenko <vda.linux@googlemail.com> | 2007-04-13 23:22:00 +0000 |
|---|---|---|
| committer | Denis Vlasenko <vda.linux@googlemail.com> | 2007-04-13 23:22:00 +0000 |
| commit | 87468857f685863cd763ae361c2cb3be0ee53a68 (patch) | |
| tree | a8fec29d731170b2a36b27d18e2d9720c970bf57 /coreutils | |
| parent | f7fcca4af7593218f2185e69715ab3ae16c6cf29 (diff) | |
| download | busybox-w32-87468857f685863cd763ae361c2cb3be0ee53a68.tar.gz busybox-w32-87468857f685863cd763ae361c2cb3be0ee53a68.tar.bz2 busybox-w32-87468857f685863cd763ae361c2cb3be0ee53a68.zip | |
style fixes
Diffstat (limited to 'coreutils')
| -rw-r--r-- | coreutils/stat.c | 68 |
1 files changed, 34 insertions, 34 deletions
diff --git a/coreutils/stat.c b/coreutils/stat.c index 7c5631764..16b8d1e44 100644 --- a/coreutils/stat.c +++ b/coreutils/stat.c | |||
| @@ -133,7 +133,7 @@ static void print_statfs(char *pformat, const size_t buf_len, const char m, | |||
| 133 | printf(pformat, statfsbuf->f_namelen); | 133 | printf(pformat, statfsbuf->f_namelen); |
| 134 | } else if (m == 't') { | 134 | } else if (m == 't') { |
| 135 | strncat(pformat, "lx", buf_len); | 135 | strncat(pformat, "lx", buf_len); |
| 136 | printf(pformat, (unsigned long int) (statfsbuf->f_type)); /* no equiv */ | 136 | printf(pformat, (unsigned long) (statfsbuf->f_type)); /* no equiv */ |
| 137 | } else if (m == 'T') { | 137 | } else if (m == 'T') { |
| 138 | strncat(pformat, "s", buf_len); | 138 | strncat(pformat, "s", buf_len); |
| 139 | printf(pformat, human_fstype(statfsbuf->f_type)); | 139 | printf(pformat, human_fstype(statfsbuf->f_type)); |
| @@ -148,7 +148,7 @@ static void print_statfs(char *pformat, const size_t buf_len, const char m, | |||
| 148 | printf(pformat, (intmax_t) (statfsbuf->f_bavail)); | 148 | printf(pformat, (intmax_t) (statfsbuf->f_bavail)); |
| 149 | } else if (m == 's' || m == 'S') { | 149 | } else if (m == 's' || m == 'S') { |
| 150 | strncat(pformat, "lu", buf_len); | 150 | strncat(pformat, "lu", buf_len); |
| 151 | printf(pformat, (unsigned long int) (statfsbuf->f_bsize)); | 151 | printf(pformat, (unsigned long) (statfsbuf->f_bsize)); |
| 152 | } else if (m == 'c') { | 152 | } else if (m == 'c') { |
| 153 | strncat(pformat, "jd", buf_len); | 153 | strncat(pformat, "jd", buf_len); |
| 154 | printf(pformat, (intmax_t) (statfsbuf->f_files)); | 154 | printf(pformat, (intmax_t) (statfsbuf->f_files)); |
| @@ -205,22 +205,22 @@ static void print_stat(char *pformat, const size_t buf_len, const char m, | |||
| 205 | printf(pformat, (uintmax_t) statbuf->st_ino); | 205 | printf(pformat, (uintmax_t) statbuf->st_ino); |
| 206 | } else if (m == 'a') { | 206 | } else if (m == 'a') { |
| 207 | strncat(pformat, "lo", buf_len); | 207 | strncat(pformat, "lo", buf_len); |
| 208 | printf(pformat, (unsigned long int) (statbuf->st_mode & (S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO))); | 208 | printf(pformat, (unsigned long) (statbuf->st_mode & (S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO))); |
| 209 | } else if (m == 'A') { | 209 | } else if (m == 'A') { |
| 210 | strncat(pformat, "s", buf_len); | 210 | strncat(pformat, "s", buf_len); |
| 211 | printf(pformat, bb_mode_string(statbuf->st_mode)); | 211 | printf(pformat, bb_mode_string(statbuf->st_mode)); |
| 212 | } else if (m == 'f') { | 212 | } else if (m == 'f') { |
| 213 | strncat(pformat, "lx", buf_len); | 213 | strncat(pformat, "lx", buf_len); |
| 214 | printf(pformat, (unsigned long int) statbuf->st_mode); | 214 | printf(pformat, (unsigned long) statbuf->st_mode); |
| 215 | } else if (m == 'F') { | 215 | } else if (m == 'F') { |
| 216 | strncat(pformat, "s", buf_len); | 216 | strncat(pformat, "s", buf_len); |
| 217 | printf(pformat, file_type(statbuf)); | 217 | printf(pformat, file_type(statbuf)); |
| 218 | } else if (m == 'h') { | 218 | } else if (m == 'h') { |
| 219 | strncat(pformat, "lu", buf_len); | 219 | strncat(pformat, "lu", buf_len); |
| 220 | printf(pformat, (unsigned long int) statbuf->st_nlink); | 220 | printf(pformat, (unsigned long) statbuf->st_nlink); |
| 221 | } else if (m == 'u') { | 221 | } else if (m == 'u') { |
| 222 | strncat(pformat, "lu", buf_len); | 222 | strncat(pformat, "lu", buf_len); |
| 223 | printf(pformat, (unsigned long int) statbuf->st_uid); | 223 | printf(pformat, (unsigned long) statbuf->st_uid); |
| 224 | } else if (m == 'U') { | 224 | } else if (m == 'U') { |
| 225 | strncat(pformat, "s", buf_len); | 225 | strncat(pformat, "s", buf_len); |
| 226 | setpwent(); | 226 | setpwent(); |
| @@ -228,7 +228,7 @@ static void print_stat(char *pformat, const size_t buf_len, const char m, | |||
| 228 | printf(pformat, (pw_ent != 0L) ? pw_ent->pw_name : "UNKNOWN"); | 228 | printf(pformat, (pw_ent != 0L) ? pw_ent->pw_name : "UNKNOWN"); |
| 229 | } else if (m == 'g') { | 229 | } else if (m == 'g') { |
| 230 | strncat(pformat, "lu", buf_len); | 230 | strncat(pformat, "lu", buf_len); |
| 231 | printf(pformat, (unsigned long int) statbuf->st_gid); | 231 | printf(pformat, (unsigned long) statbuf->st_gid); |
| 232 | } else if (m == 'G') { | 232 | } else if (m == 'G') { |
| 233 | strncat(pformat, "s", buf_len); | 233 | strncat(pformat, "s", buf_len); |
| 234 | setgrent(); | 234 | setgrent(); |
| @@ -236,40 +236,40 @@ static void print_stat(char *pformat, const size_t buf_len, const char m, | |||
| 236 | printf(pformat, (gw_ent != 0L) ? gw_ent->gr_name : "UNKNOWN"); | 236 | printf(pformat, (gw_ent != 0L) ? gw_ent->gr_name : "UNKNOWN"); |
| 237 | } else if (m == 't') { | 237 | } else if (m == 't') { |
| 238 | strncat(pformat, "lx", buf_len); | 238 | strncat(pformat, "lx", buf_len); |
| 239 | printf(pformat, (unsigned long int) major(statbuf->st_rdev)); | 239 | printf(pformat, (unsigned long) major(statbuf->st_rdev)); |
| 240 | } else if (m == 'T') { | 240 | } else if (m == 'T') { |
| 241 | strncat(pformat, "lx", buf_len); | 241 | strncat(pformat, "lx", buf_len); |
| 242 | printf(pformat, (unsigned long int) minor(statbuf->st_rdev)); | 242 | printf(pformat, (unsigned long) minor(statbuf->st_rdev)); |
| 243 | } else if (m == 's') { | 243 | } else if (m == 's') { |
| 244 | strncat(pformat, "ju", buf_len); | 244 | strncat(pformat, "ju", buf_len); |
| 245 | printf(pformat, (uintmax_t) (statbuf->st_size)); | 245 | printf(pformat, (uintmax_t) (statbuf->st_size)); |
| 246 | } else if (m == 'B') { | 246 | } else if (m == 'B') { |
| 247 | strncat(pformat, "lu", buf_len); | 247 | strncat(pformat, "lu", buf_len); |
| 248 | printf(pformat, (unsigned long int) 512); //ST_NBLOCKSIZE | 248 | printf(pformat, (unsigned long) 512); //ST_NBLOCKSIZE |
| 249 | } else if (m == 'b') { | 249 | } else if (m == 'b') { |
| 250 | strncat(pformat, "ju", buf_len); | 250 | strncat(pformat, "ju", buf_len); |
| 251 | printf(pformat, (uintmax_t) statbuf->st_blocks); | 251 | printf(pformat, (uintmax_t) statbuf->st_blocks); |
| 252 | } else if (m == 'o') { | 252 | } else if (m == 'o') { |
| 253 | strncat(pformat, "lu", buf_len); | 253 | strncat(pformat, "lu", buf_len); |
| 254 | printf(pformat, (unsigned long int) statbuf->st_blksize); | 254 | printf(pformat, (unsigned long) statbuf->st_blksize); |
| 255 | } else if (m == 'x') { | 255 | } else if (m == 'x') { |
| 256 | strncat(pformat, "s", buf_len); | 256 | strncat(pformat, "s", buf_len); |
| 257 | printf(pformat, human_time(statbuf->st_atime)); | 257 | printf(pformat, human_time(statbuf->st_atime)); |
| 258 | } else if (m == 'X') { | 258 | } else if (m == 'X') { |
| 259 | strncat(pformat, TYPE_SIGNED(time_t) ? "ld" : "lu", buf_len); | 259 | strncat(pformat, TYPE_SIGNED(time_t) ? "ld" : "lu", buf_len); |
| 260 | printf(pformat, (unsigned long int) statbuf->st_atime); | 260 | printf(pformat, (unsigned long) statbuf->st_atime); |
| 261 | } else if (m == 'y') { | 261 | } else if (m == 'y') { |
| 262 | strncat(pformat, "s", buf_len); | 262 | strncat(pformat, "s", buf_len); |
| 263 | printf(pformat, human_time(statbuf->st_mtime)); | 263 | printf(pformat, human_time(statbuf->st_mtime)); |
| 264 | } else if (m == 'Y') { | 264 | } else if (m == 'Y') { |
| 265 | strncat(pformat, TYPE_SIGNED(time_t) ? "ld" : "lu", buf_len); | 265 | strncat(pformat, TYPE_SIGNED(time_t) ? "ld" : "lu", buf_len); |
| 266 | printf(pformat, (unsigned long int) statbuf->st_mtime); | 266 | printf(pformat, (unsigned long) statbuf->st_mtime); |
| 267 | } else if (m == 'z') { | 267 | } else if (m == 'z') { |
| 268 | strncat(pformat, "s", buf_len); | 268 | strncat(pformat, "s", buf_len); |
| 269 | printf(pformat, human_time(statbuf->st_ctime)); | 269 | printf(pformat, human_time(statbuf->st_ctime)); |
| 270 | } else if (m == 'Z') { | 270 | } else if (m == 'Z') { |
| 271 | strncat(pformat, TYPE_SIGNED(time_t) ? "ld" : "lu", buf_len); | 271 | strncat(pformat, TYPE_SIGNED(time_t) ? "ld" : "lu", buf_len); |
| 272 | printf(pformat, (unsigned long int) statbuf->st_ctime); | 272 | printf(pformat, (unsigned long) statbuf->st_ctime); |
| 273 | #if ENABLE_SELINUX | 273 | #if ENABLE_SELINUX |
| 274 | } else if (m == 'C' && (option_mask32 & OPT_SELINUX)) { | 274 | } else if (m == 'C' && (option_mask32 & OPT_SELINUX)) { |
| 275 | strncat(pformat, "s", buf_len); | 275 | strncat(pformat, "s", buf_len); |
| @@ -395,7 +395,7 @@ static bool do_statfs(char const *filename, char const *format) | |||
| 395 | statfsbuf.f_namelen); | 395 | statfsbuf.f_namelen); |
| 396 | 396 | ||
| 397 | if (option_mask32 & OPT_TERSE) | 397 | if (option_mask32 & OPT_TERSE) |
| 398 | printf("%lx ", (unsigned long int) (statfsbuf.f_type)); | 398 | printf("%lx ", (unsigned long) (statfsbuf.f_type)); |
| 399 | else | 399 | else |
| 400 | printf("Type: %s\n", human_fstype(statfsbuf.f_type)); | 400 | printf("Type: %s\n", human_fstype(statfsbuf.f_type)); |
| 401 | 401 | ||
| @@ -406,7 +406,7 @@ static bool do_statfs(char const *filename, char const *format) | |||
| 406 | "Blocks: Total: %-10jd Free: %-10jd Available: %jd\n" | 406 | "Blocks: Total: %-10jd Free: %-10jd Available: %jd\n" |
| 407 | "Inodes: Total: %-10jd Free: %jd\n"); | 407 | "Inodes: Total: %-10jd Free: %jd\n"); |
| 408 | printf(format, | 408 | printf(format, |
| 409 | (unsigned long int) (statfsbuf.f_bsize), | 409 | (unsigned long) (statfsbuf.f_bsize), |
| 410 | (intmax_t) (statfsbuf.f_blocks), | 410 | (intmax_t) (statfsbuf.f_blocks), |
| 411 | (intmax_t) (statfsbuf.f_bfree), | 411 | (intmax_t) (statfsbuf.f_bfree), |
| 412 | (intmax_t) (statfsbuf.f_bavail), | 412 | (intmax_t) (statfsbuf.f_bavail), |
| @@ -425,7 +425,7 @@ static bool do_statfs(char const *filename, char const *format) | |||
| 425 | "Blocks: Total: %-10jd Free: %-10jd Available: %jd\n" | 425 | "Blocks: Total: %-10jd Free: %-10jd Available: %jd\n" |
| 426 | "Inodes: Total: %-10jd Free: %jd\n")); | 426 | "Inodes: Total: %-10jd Free: %jd\n")); |
| 427 | printf(format, | 427 | printf(format, |
| 428 | (unsigned long int) (statfsbuf.f_bsize), | 428 | (unsigned long) (statfsbuf.f_bsize), |
| 429 | (intmax_t) (statfsbuf.f_blocks), | 429 | (intmax_t) (statfsbuf.f_blocks), |
| 430 | (intmax_t) (statfsbuf.f_bfree), | 430 | (intmax_t) (statfsbuf.f_bfree), |
| 431 | (intmax_t) (statfsbuf.f_bavail), | 431 | (intmax_t) (statfsbuf.f_bavail), |
| @@ -529,18 +529,18 @@ static bool do_stat(char const *filename, char const *format) | |||
| 529 | filename, | 529 | filename, |
| 530 | (uintmax_t) (statbuf.st_size), | 530 | (uintmax_t) (statbuf.st_size), |
| 531 | (uintmax_t) statbuf.st_blocks, | 531 | (uintmax_t) statbuf.st_blocks, |
| 532 | (unsigned long int) statbuf.st_mode, | 532 | (unsigned long) statbuf.st_mode, |
| 533 | (unsigned long int) statbuf.st_uid, | 533 | (unsigned long) statbuf.st_uid, |
| 534 | (unsigned long int) statbuf.st_gid, | 534 | (unsigned long) statbuf.st_gid, |
| 535 | (uintmax_t) statbuf.st_dev, | 535 | (uintmax_t) statbuf.st_dev, |
| 536 | (uintmax_t) statbuf.st_ino, | 536 | (uintmax_t) statbuf.st_ino, |
| 537 | (unsigned long int) statbuf.st_nlink, | 537 | (unsigned long) statbuf.st_nlink, |
| 538 | (unsigned long int) major(statbuf.st_rdev), | 538 | (unsigned long) major(statbuf.st_rdev), |
| 539 | (unsigned long int) minor(statbuf.st_rdev), | 539 | (unsigned long) minor(statbuf.st_rdev), |
| 540 | (unsigned long int) statbuf.st_atime, | 540 | (unsigned long) statbuf.st_atime, |
| 541 | (unsigned long int) statbuf.st_mtime, | 541 | (unsigned long) statbuf.st_mtime, |
| 542 | (unsigned long int) statbuf.st_ctime, | 542 | (unsigned long) statbuf.st_ctime, |
| 543 | (unsigned long int) statbuf.st_blksize | 543 | (unsigned long) statbuf.st_blksize |
| 544 | ); | 544 | ); |
| 545 | #if ENABLE_SELINUX | 545 | #if ENABLE_SELINUX |
| 546 | if (option_mask32 & OPT_SELINUX) | 546 | if (option_mask32 & OPT_SELINUX) |
| @@ -569,24 +569,24 @@ static bool do_stat(char const *filename, char const *format) | |||
| 569 | "Device: %jxh/%jud\tInode: %-10ju Links: %-5lu", | 569 | "Device: %jxh/%jud\tInode: %-10ju Links: %-5lu", |
| 570 | (uintmax_t) (statbuf.st_size), | 570 | (uintmax_t) (statbuf.st_size), |
| 571 | (uintmax_t) statbuf.st_blocks, | 571 | (uintmax_t) statbuf.st_blocks, |
| 572 | (unsigned long int) statbuf.st_blksize, | 572 | (unsigned long) statbuf.st_blksize, |
| 573 | file_type(&statbuf), | 573 | file_type(&statbuf), |
| 574 | (uintmax_t) statbuf.st_dev, | 574 | (uintmax_t) statbuf.st_dev, |
| 575 | (uintmax_t) statbuf.st_dev, | 575 | (uintmax_t) statbuf.st_dev, |
| 576 | (uintmax_t) statbuf.st_ino, | 576 | (uintmax_t) statbuf.st_ino, |
| 577 | (unsigned long int) statbuf.st_nlink); | 577 | (unsigned long) statbuf.st_nlink); |
| 578 | if (S_ISBLK(statbuf.st_mode) || S_ISCHR(statbuf.st_mode)) | 578 | if (S_ISBLK(statbuf.st_mode) || S_ISCHR(statbuf.st_mode)) |
| 579 | printf(" Device type: %lx,%lx\n", | 579 | printf(" Device type: %lx,%lx\n", |
| 580 | (unsigned long int) major(statbuf.st_rdev), | 580 | (unsigned long) major(statbuf.st_rdev), |
| 581 | (unsigned long int) minor(statbuf.st_rdev)); | 581 | (unsigned long) minor(statbuf.st_rdev)); |
| 582 | else | 582 | else |
| 583 | putchar('\n'); | 583 | putchar('\n'); |
| 584 | printf("Access: (%04lo/%10.10s) Uid: (%5lu/%8s) Gid: (%5lu/%8s)\n", | 584 | printf("Access: (%04lo/%10.10s) Uid: (%5lu/%8s) Gid: (%5lu/%8s)\n", |
| 585 | (unsigned long int) (statbuf.st_mode & (S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO)), | 585 | (unsigned long) (statbuf.st_mode & (S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO)), |
| 586 | bb_mode_string(statbuf.st_mode), | 586 | bb_mode_string(statbuf.st_mode), |
| 587 | (unsigned long int) statbuf.st_uid, | 587 | (unsigned long) statbuf.st_uid, |
| 588 | (pw_ent != 0L) ? pw_ent->pw_name : "UNKNOWN", | 588 | (pw_ent != 0L) ? pw_ent->pw_name : "UNKNOWN", |
| 589 | (unsigned long int) statbuf.st_gid, | 589 | (unsigned long) statbuf.st_gid, |
| 590 | (gw_ent != 0L) ? gw_ent->gr_name : "UNKNOWN"); | 590 | (gw_ent != 0L) ? gw_ent->gr_name : "UNKNOWN"); |
| 591 | #if ENABLE_SELINUX | 591 | #if ENABLE_SELINUX |
| 592 | printf(" S_Context: %lc\n", *scontext); | 592 | printf(" S_Context: %lc\n", *scontext); |
