aboutsummaryrefslogtreecommitdiff
path: root/coreutils/stat.c
diff options
context:
space:
mode:
Diffstat (limited to 'coreutils/stat.c')
-rw-r--r--coreutils/stat.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/coreutils/stat.c b/coreutils/stat.c
index e501fb41d..dc9d81c35 100644
--- a/coreutils/stat.c
+++ b/coreutils/stat.c
@@ -338,11 +338,7 @@ static void FAST_FUNC print_stat(char *pformat, const char m,
338 printf(pformat, (unsigned long long) statbuf->st_blocks); 338 printf(pformat, (unsigned long long) statbuf->st_blocks);
339 } else if (m == 'o') { 339 } else if (m == 'o') {
340 strcat(pformat, "lu"); 340 strcat(pformat, "lu");
341#if !ENABLE_PLATFORM_MINGW32
342 printf(pformat, (unsigned long) statbuf->st_blksize); 341 printf(pformat, (unsigned long) statbuf->st_blksize);
343#else
344 printf(pformat, (unsigned long) 4096);
345#endif
346 } else if (m == 'x') { 342 } else if (m == 'x') {
347 printfs(pformat, human_time(statbuf->st_atime)); 343 printfs(pformat, human_time(statbuf->st_atime));
348 } else if (m == 'X') { 344 } else if (m == 'X') {
@@ -550,7 +546,6 @@ static bool do_statfs(const char *filename, const char *format)
550static bool do_stat(const char *filename, const char *format) 546static bool do_stat(const char *filename, const char *format)
551{ 547{
552 struct stat statbuf; 548 struct stat statbuf;
553 int status;
554#if ENABLE_SELINUX 549#if ENABLE_SELINUX
555 security_context_t scontext = NULL; 550 security_context_t scontext = NULL;
556 551
@@ -565,8 +560,7 @@ static bool do_stat(const char *filename, const char *format)
565 } 560 }
566 } 561 }
567#endif 562#endif
568 status = option_mask32 & OPT_DEREFERENCE ? stat(filename, &statbuf) : lstat(filename, &statbuf); 563 if ((option_mask32 & OPT_DEREFERENCE ? stat : lstat) (filename, &statbuf) != 0) {
569 if (status != 0) {
570 bb_perror_msg("can't stat '%s'", filename); 564 bb_perror_msg("can't stat '%s'", filename);
571 return 0; 565 return 0;
572 } 566 }