Print information about F in long format. */
| 4234 | |
| 4235 | /* Print information about F in long format. */ |
| 4236 | static void |
| 4237 | print_long_format (const struct fileinfo *f) |
| 4238 | { |
| 4239 | char modebuf[12]; |
| 4240 | char buf |
| 4241 | [LONGEST_HUMAN_READABLE + 1 /* inode */ |
| 4242 | + LONGEST_HUMAN_READABLE + 1 /* size in blocks */ |
| 4243 | + sizeof (modebuf) - 1 + 1 /* mode string */ |
| 4244 | + INT_BUFSIZE_BOUND (uintmax_t) /* st_nlink */ |
| 4245 | + LONGEST_HUMAN_READABLE + 2 /* major device number */ |
| 4246 | + LONGEST_HUMAN_READABLE + 1 /* minor device number */ |
| 4247 | + TIME_STAMP_LEN_MAXIMUM + 1 /* max length of time/date */ |
| 4248 | ]; |
| 4249 | ptrdiff_t s; |
| 4250 | char *p; |
| 4251 | struct timespec when_timespec; |
| 4252 | struct tm when_local; |
| 4253 | bool btime_ok = true; |
| 4254 | |
| 4255 | /* Compute the mode string, except remove the trailing space if no |
| 4256 | file in this directory has an ACL or security context. */ |
| 4257 | if (f->stat_ok) |
| 4258 | filemodestring (&f->stat, modebuf); |
| 4259 | else |
| 4260 | { |
| 4261 | modebuf[0] = filetype_letter[f->filetype]; |
| 4262 | memset (modebuf + 1, '?', 10); |
| 4263 | modebuf[11] = '\0'; |
| 4264 | } |
| 4265 | if (! any_has_acl) |
| 4266 | modebuf[10] = '\0'; |
| 4267 | else if (f->acl_type == ACL_T_LSM_CONTEXT_ONLY) |
| 4268 | modebuf[10] = '.'; |
| 4269 | else if (f->acl_type == ACL_T_YES) |
| 4270 | modebuf[10] = '+'; |
| 4271 | else if (f->acl_type == ACL_T_UNKNOWN) |
| 4272 | modebuf[10] = '?'; |
| 4273 | |
| 4274 | switch (time_type) |
| 4275 | { |
| 4276 | case time_ctime: |
| 4277 | when_timespec = get_stat_ctime (&f->stat); |
| 4278 | break; |
| 4279 | case time_mtime: |
| 4280 | when_timespec = get_stat_mtime (&f->stat); |
| 4281 | break; |
| 4282 | case time_atime: |
| 4283 | when_timespec = get_stat_atime (&f->stat); |
| 4284 | break; |
| 4285 | case time_btime: |
| 4286 | when_timespec = get_stat_btime (&f->stat); |
| 4287 | if (when_timespec.tv_sec == -1 && when_timespec.tv_nsec == -1) |
| 4288 | btime_ok = false; |
| 4289 | break; |
| 4290 | case time_numtypes: default: |
| 4291 | unreachable (); |
| 4292 | } |
| 4293 |
no test coverage detected