diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2018-11-01 21:46:50 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2018-11-01 21:46:50 -0400 |
commit | 8c3b9aaaab11be9d0fe24a72ebb16e171ca22125 (patch) | |
tree | 1eceebe2763cec5a010a193d48b50edef5fb78a2 /eval.c | |
parent | b74261ac825ec2b9c02d73e36f7b44b64c9d184c (diff) | |
download | bfs-8c3b9aaaab11be9d0fe24a72ebb16e171ca22125.tar.xz |
Print device major/minor numbers for -ls
Diffstat (limited to 'eval.c')
-rw-r--r-- | eval.c | 14 |
1 files changed, 11 insertions, 3 deletions
@@ -658,9 +658,17 @@ bool eval_fls(const struct expr *expr, struct eval_state *state) { } } - uintmax_t size = statbuf->size; - if (fprintf(file, " %8ju", size) < 0) { - goto error; + if (ftwbuf->typeflag & (BFTW_BLK | BFTW_CHR)) { + int ma = bfs_major(statbuf->rdev); + int mi = bfs_minor(statbuf->rdev); + if (fprintf(file, " %3d, %3d", ma, mi) < 0) { + goto error; + } + } else { + uintmax_t size = statbuf->size; + if (fprintf(file, " %8ju", size) < 0) { + goto error; + } } time_t time = statbuf->mtime.tv_sec; |