Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F176190166
D16611.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
3 KB
Referenced Files
None
Subscribers
None
D16611.diff
View Options
Index: head/usr.bin/kdump/kdump.c
===================================================================
--- head/usr.bin/kdump/kdump.c
+++ head/usr.bin/kdump/kdump.c
@@ -125,8 +125,9 @@
#define TIMESTAMP_ELAPSED 0x2
#define TIMESTAMP_RELATIVE 0x4
-static int timestamp, decimal, fancy = 1, suppressdata, tail, threads, maxdata,
- resolv = 0, abiflag = 0, syscallno = 0;
+static bool abiflag, decimal, fancy = true, resolv, suppressdata, syscallno,
+ tail, threads;
+static int timestamp, maxdata;
static const char *tracefile = DEF_TRACEFILE;
static struct ktr_header ktr_header;
@@ -363,40 +364,40 @@
while ((ch = getopt(argc,argv,"f:dElm:np:AHRrSsTt:")) != -1)
switch (ch) {
case 'A':
- abiflag = 1;
+ abiflag = true;
break;
case 'f':
tracefile = optarg;
break;
case 'd':
- decimal = 1;
+ decimal = true;
break;
case 'l':
- tail = 1;
+ tail = true;
break;
case 'm':
maxdata = atoi(optarg);
break;
case 'n':
- fancy = 0;
+ fancy = false;
break;
case 'p':
pid = atoi(optarg);
break;
case 'r':
- resolv = 1;
+ resolv = true;
break;
case 'S':
- syscallno = 1;
+ syscallno = true;
break;
case 's':
- suppressdata = 1;
+ suppressdata = true;
break;
case 'E':
timestamp |= TIMESTAMP_ELAPSED;
break;
case 'H':
- threads = 1;
+ threads = true;
break;
case 'R':
timestamp |= TIMESTAMP_RELATIVE;
@@ -427,18 +428,18 @@
caph_cache_tzdata();
#ifdef WITH_CASPER
- if (resolv != 0) {
+ if (resolv) {
if (cappwdgrp_setup(&cappwd, &capgrp) < 0) {
cappwd = NULL;
capgrp = NULL;
}
}
- if (resolv == 0 || (cappwd != NULL && capgrp != NULL)) {
+ if (!resolv || (cappwd != NULL && capgrp != NULL)) {
if (caph_enter() < 0)
err(1, "unable to enter capability mode");
}
#else
- if (resolv == 0) {
+ if (!resolv) {
if (caph_enter() < 0)
err(1, "unable to enter capability mode");
}
@@ -1835,14 +1836,14 @@
printf("struct stat {");
printf("dev=%ju, ino=%ju, ",
(uintmax_t)statp->st_dev, (uintmax_t)statp->st_ino);
- if (resolv == 0)
+ if (!resolv)
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) {
+ if (!resolv) {
pwd = NULL;
} else {
#ifdef WITH_CASPER
@@ -1856,7 +1857,7 @@
printf("uid=%ju, ", (uintmax_t)statp->st_uid);
else
printf("uid=\"%s\", ", pwd->pw_name);
- if (resolv == 0) {
+ if (!resolv) {
grp = NULL;
} else {
#ifdef WITH_CASPER
@@ -1872,7 +1873,7 @@
printf("gid=\"%s\", ", grp->gr_name);
printf("rdev=%ju, ", (uintmax_t)statp->st_rdev);
printf("atime=");
- if (resolv == 0)
+ if (!resolv)
printf("%jd", (intmax_t)statp->st_atim.tv_sec);
else {
tm = localtime(&statp->st_atim.tv_sec);
@@ -1884,7 +1885,7 @@
else
printf(", ");
printf("mtime=");
- if (resolv == 0)
+ if (!resolv)
printf("%jd", (intmax_t)statp->st_mtim.tv_sec);
else {
tm = localtime(&statp->st_mtim.tv_sec);
@@ -1896,7 +1897,7 @@
else
printf(", ");
printf("ctime=");
- if (resolv == 0)
+ if (!resolv)
printf("%jd", (intmax_t)statp->st_ctim.tv_sec);
else {
tm = localtime(&statp->st_ctim.tv_sec);
@@ -1908,7 +1909,7 @@
else
printf(", ");
printf("birthtime=");
- if (resolv == 0)
+ if (!resolv)
printf("%jd", (intmax_t)statp->st_birthtim.tv_sec);
else {
tm = localtime(&statp->st_birthtim.tv_sec);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Oct 17, 8:04 PM (4 h, 17 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
40964373
Default Alt Text
D16611.diff (3 KB)
Attached To
Mode
D16611: Use 'bool' instead of 'int' for various boolean flags.
Attached
Detach File
Event Timeline
Log In to Comment