From fb9e5c21670ff439e1075dd2bc049a0aec034c43 Mon Sep 17 00:00:00 2001 From: Xin LI Date: Thu, 12 Sep 2013 00:14:25 +0000 Subject: [PATCH] Do not emit size for non-regular files. There is nothing that mtree(1) can do in this situation and would cause confusion. MFC candidate. Approved by: re (hrs) --- usr.sbin/mtree/create.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/mtree/create.c b/usr.sbin/mtree/create.c index da72fc6beae..8be9b02173e 100644 --- a/usr.sbin/mtree/create.c +++ b/usr.sbin/mtree/create.c @@ -208,7 +208,7 @@ statf(int indent, FTSENT *p) output(indent, &offset, "mode=%#o", p->fts_statp->st_mode & MBITS); if (keys & F_NLINK && p->fts_statp->st_nlink != 1) output(indent, &offset, "nlink=%u", p->fts_statp->st_nlink); - if (keys & F_SIZE) + if (keys & F_SIZE && S_ISREG(p->fts_statp->st_mode)) output(indent, &offset, "size=%jd", (intmax_t)p->fts_statp->st_size); if (keys & F_TIME)