diff options
author | des <des@FreeBSD.org> | 2013-10-07 11:23:01 +0000 |
---|---|---|
committer | des <des@FreeBSD.org> | 2013-10-07 11:23:01 +0000 |
commit | 4ecb899fb0e09a90a4b490ec1146b56b16cb43c7 (patch) | |
tree | 4b69b0169d94e9fd7589e949be6335a0c202447b | |
parent | 8984ced46c19636db8da912360c2bde89cb685be (diff) | |
download | FreeBSD-src-4ecb899fb0e09a90a4b490ec1146b56b16cb43c7.zip FreeBSD-src-4ecb899fb0e09a90a4b490ec1146b56b16cb43c7.tar.gz |
When displaying a struct stat, if the -r option was not specified,
display the numeric rather than symbolic representation of st_mode.
Approved by: re (glebius)
MFC after: 1 week
-rw-r--r-- | usr.bin/kdump/kdump.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/usr.bin/kdump/kdump.c b/usr.bin/kdump/kdump.c index e3e6927..24bb0fd 100644 --- a/usr.bin/kdump/kdump.c +++ b/usr.bin/kdump/kdump.c @@ -1655,10 +1655,15 @@ ktrstat(struct stat *statp) * buffer exactly sizeof(struct stat) bytes long. */ printf("struct stat {"); - strmode(statp->st_mode, mode); - printf("dev=%ju, ino=%ju, mode=%s, nlink=%ju, ", - (uintmax_t)statp->st_dev, (uintmax_t)statp->st_ino, mode, - (uintmax_t)statp->st_nlink); + printf("dev=%ju, ino=%ju, ", + (uintmax_t)statp->st_dev, (uintmax_t)statp->st_ino); + if (resolv == 0) + printf("mode=0%jo, ", (uintmax_t)statp->st_mode); + else { + strmode(statp->st_mode, mode); + printf("mode=%s, ", mode); + } + printf("nlink=%ju, ", (uintmax_t)statp->st_nlink); if (resolv == 0 || (pwd = getpwuid(statp->st_uid)) == NULL) printf("uid=%ju, ", (uintmax_t)statp->st_uid); else |