diff options
author | Eric Blake <eblake@redhat.com> | 2010-10-05 09:02:37 -0600 |
---|---|---|
committer | Eric Blake <eblake@redhat.com> | 2010-10-05 09:07:58 -0600 |
commit | b7459696dca96015688e82c81eaefad756b63ddc (patch) | |
tree | 9161b78ce6f91cb170aee4a0f0a3645a390a9dab /src | |
parent | 4c286d341a5443ca9044ac3aca3b69d941f5e531 (diff) | |
download | coreutils-b7459696dca96015688e82c81eaefad756b63ddc.tar.xz |
stat: drop %C support when printing file system details
* src/stat.c (print_statfs, usage): Drop %C, since it applies to
files, not file systems.
(out_file_context): Match style of other out_* functions.
(print_stat): Update caller.
* doc/coreutils.texi (stat invocation): Document %C.
* NEWS: Document the change.
Diffstat (limited to 'src')
-rw-r--r-- | src/stat.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/src/stat.c b/src/stat.c index f742f1ed3..fabbc17e1 100644 --- a/src/stat.c +++ b/src/stat.c @@ -513,11 +513,10 @@ out_uint_x (char *pformat, size_t prefix_len, uintmax_t arg) printf (pformat, arg); } -/* Very specialized function (modifies FORMAT), just so as to avoid - duplicating this code between both print_statfs and print_stat. - Return zero upon success, nonzero upon failure. */ +/* Print the context information of FILENAME, and return true iff the + context could not be obtained. */ static bool ATTRIBUTE_WARN_UNUSED_RESULT -out_file_context (char const *filename, char *pformat, size_t prefix_len) +out_file_context (char *pformat, size_t prefix_len, char const *filename) { char *scontext; bool fail = false; @@ -617,9 +616,6 @@ print_statfs (char *pformat, size_t prefix_len, char m, char const *filename, case 'd': out_int (pformat, prefix_len, statfsbuf->f_ffree); break; - case 'C': - fail |= out_file_context (filename, pformat, prefix_len); - break; default: fputc ('?', stdout); break; @@ -846,7 +842,7 @@ print_stat (char *pformat, size_t prefix_len, char m, out_string (pformat, prefix_len, epoch_time (get_stat_ctime (statbuf))); break; case 'C': - fail |= out_file_context (filename, pformat, prefix_len); + fail |= out_file_context (pformat, prefix_len, filename); break; default: fputc ('?', stdout); @@ -1238,7 +1234,6 @@ Valid format sequences for file systems:\n\ %c Total file nodes in file system\n\ %d Free file nodes in file system\n\ %f Free blocks in file system\n\ - %C SELinux security context string\n\ "), stdout); fputs (_("\ %i File System ID in hex\n\ |