diff options
-rw-r--r-- | coreutils/ls.c | 14 | ||||
-rw-r--r-- | include/mingw.h | 1 |
2 files changed, 6 insertions, 9 deletions
diff --git a/coreutils/ls.c b/coreutils/ls.c index 9876c2db2..4fe291d17 100644 --- a/coreutils/ls.c +++ b/coreutils/ls.c | |||
@@ -335,9 +335,7 @@ struct dnode { | |||
335 | time_t dn_ctime; | 335 | time_t dn_ctime; |
336 | #endif | 336 | #endif |
337 | ino_t dn_ino; | 337 | ino_t dn_ino; |
338 | #if !ENABLE_PLATFORM_MINGW32 | ||
339 | blkcnt_t dn_blocks; | 338 | blkcnt_t dn_blocks; |
340 | #endif | ||
341 | nlink_t dn_nlink; | 339 | nlink_t dn_nlink; |
342 | uid_t dn_uid; | 340 | uid_t dn_uid; |
343 | gid_t dn_gid; | 341 | gid_t dn_gid; |
@@ -524,12 +522,7 @@ static NOINLINE unsigned display_single(const struct dnode *dn) | |||
524 | column += printf("%7llu ", (long long) dn->dn_ino); | 522 | column += printf("%7llu ", (long long) dn->dn_ino); |
525 | //TODO: -h should affect -s too: | 523 | //TODO: -h should affect -s too: |
526 | if (G.all_fmt & LIST_BLOCKS) | 524 | if (G.all_fmt & LIST_BLOCKS) |
527 | #if ENABLE_PLATFORM_MINGW32 | ||
528 | /* MinGW does not have st_blocks */ | ||
529 | column += printf("%6"OFF_FMT"u ", (off_t)0); | ||
530 | #else | ||
531 | column += printf("%6"OFF_FMT"u ", (off_t) (dn->dn_blocks >> 1)); | 525 | column += printf("%6"OFF_FMT"u ", (off_t) (dn->dn_blocks >> 1)); |
532 | #endif | ||
533 | if (G.all_fmt & LIST_MODEBITS) | 526 | if (G.all_fmt & LIST_MODEBITS) |
534 | column += printf("%-10s ", (char *) bb_mode_string(dn->dn_mode)); | 527 | column += printf("%-10s ", (char *) bb_mode_string(dn->dn_mode)); |
535 | if (G.all_fmt & LIST_NLINKS) | 528 | if (G.all_fmt & LIST_NLINKS) |
@@ -763,6 +756,9 @@ static struct dnode *my_stat(const char *fullname, const char *name, int force_f | |||
763 | cur->dn_ino = statbuf.st_ino ; | 756 | cur->dn_ino = statbuf.st_ino ; |
764 | #if !ENABLE_PLATFORM_MINGW32 | 757 | #if !ENABLE_PLATFORM_MINGW32 |
765 | cur->dn_blocks = statbuf.st_blocks; | 758 | cur->dn_blocks = statbuf.st_blocks; |
759 | #else | ||
760 | /* MinGW does not have st_blocks */ | ||
761 | cur->dn_blocks = 0; | ||
766 | #endif | 762 | #endif |
767 | cur->dn_nlink = statbuf.st_nlink ; | 763 | cur->dn_nlink = statbuf.st_nlink ; |
768 | cur->dn_uid = statbuf.st_uid ; | 764 | cur->dn_uid = statbuf.st_uid ; |
@@ -998,7 +994,7 @@ static struct dnode **scan_one_dir(const char *path, unsigned *nfiles_p) | |||
998 | return dnp; | 994 | return dnp; |
999 | } | 995 | } |
1000 | 996 | ||
1001 | #if ENABLE_DESKTOP && !ENABLE_PLATFORM_MINGW32 | 997 | #if ENABLE_DESKTOP |
1002 | /* http://www.opengroup.org/onlinepubs/9699919799/utilities/ls.html | 998 | /* http://www.opengroup.org/onlinepubs/9699919799/utilities/ls.html |
1003 | * If any of the -l, -n, -s options is specified, each list | 999 | * If any of the -l, -n, -s options is specified, each list |
1004 | * of files within the directory shall be preceded by a | 1000 | * of files within the directory shall be preceded by a |
@@ -1040,7 +1036,7 @@ static void scan_and_display_dirs_recur(struct dnode **dn, int first) | |||
1040 | printf("%s:\n", (*dn)->fullname); | 1036 | printf("%s:\n", (*dn)->fullname); |
1041 | } | 1037 | } |
1042 | subdnp = scan_one_dir((*dn)->fullname, &nfiles); | 1038 | subdnp = scan_one_dir((*dn)->fullname, &nfiles); |
1043 | #if ENABLE_DESKTOP && !ENABLE_PLATFORM_MINGW32 | 1039 | #if ENABLE_DESKTOP |
1044 | if ((G.all_fmt & STYLE_MASK) == STYLE_LONG) | 1040 | if ((G.all_fmt & STYLE_MASK) == STYLE_LONG) |
1045 | printf("total %"OFF_FMT"u\n", calculate_blocks(subdnp)); | 1041 | printf("total %"OFF_FMT"u\n", calculate_blocks(subdnp)); |
1046 | #endif | 1042 | #endif |
diff --git a/include/mingw.h b/include/mingw.h index 69bf05574..89268d62b 100644 --- a/include/mingw.h +++ b/include/mingw.h | |||
@@ -209,6 +209,7 @@ NOIMPL(mingw_bind,SOCKET s UNUSED_PARAM,const struct sockaddr* sa UNUSED_PARAM,i | |||
209 | /* | 209 | /* |
210 | * sys/stat.h | 210 | * sys/stat.h |
211 | */ | 211 | */ |
212 | typedef int blkcnt_t; | ||
212 | typedef int nlink_t; | 213 | typedef int nlink_t; |
213 | 214 | ||
214 | #define S_ISUID 04000 | 215 | #define S_ISUID 04000 |