Stat the file system and print what we find. */
| 1255 | |
| 1256 | /* Stat the file system and print what we find. */ |
| 1257 | NODISCARD |
| 1258 | static bool |
| 1259 | do_statfs (char const *filename, char const *format) |
| 1260 | { |
| 1261 | STRUCT_STATVFS statfsbuf; |
| 1262 | |
| 1263 | if (streq (filename, "-")) |
| 1264 | { |
| 1265 | error (0, 0, _("using %s to denote standard input does not work" |
| 1266 | " in file system mode"), quoteaf (filename)); |
| 1267 | return false; |
| 1268 | } |
| 1269 | |
| 1270 | if (STATFS (filename, &statfsbuf) != 0) |
| 1271 | { |
| 1272 | error (0, errno, _("cannot read file system information for %s"), |
| 1273 | quoteaf (filename)); |
| 1274 | return false; |
| 1275 | } |
| 1276 | |
| 1277 | bool fail = print_it (format, -1, filename, print_statfs, &statfsbuf); |
| 1278 | return ! fail; |
| 1279 | } |
| 1280 | |
| 1281 | struct print_args { |
| 1282 | struct stat *st; |