summaryrefslogtreecommitdiffstats
path: root/sys/ddb
diff options
context:
space:
mode:
authorgjb <gjb@FreeBSD.org>2016-04-16 02:32:12 +0000
committergjb <gjb@FreeBSD.org>2016-04-16 02:32:12 +0000
commit6549ef7d128d37c0dfff87f6c1c189b42ed3e1ef (patch)
treea8871301d693c6d33d43cd3171b1ee4783fec0e4 /sys/ddb
parentae096a53a90aee9859587d48d5a0279567abb413 (diff)
parent35691f7a6f04cec368d8636543bca596e870faf3 (diff)
downloadFreeBSD-src-6549ef7d128d37c0dfff87f6c1c189b42ed3e1ef.zip
FreeBSD-src-6549ef7d128d37c0dfff87f6c1c189b42ed3e1ef.tar.gz
MFH
Sponsored by: The FreeBSD Foundation
Diffstat (limited to 'sys/ddb')
-rw-r--r--sys/ddb/db_command.c4
-rw-r--r--sys/ddb/db_ps.c3
-rw-r--r--sys/ddb/db_sym.c6
3 files changed, 7 insertions, 6 deletions
diff --git a/sys/ddb/db_command.c b/sys/ddb/db_command.c
index 0d4f28f..4f66498 100644
--- a/sys/ddb/db_command.c
+++ b/sys/ddb/db_command.c
@@ -144,7 +144,7 @@ static struct command db_cmds[] = {
};
struct command_table db_cmd_table = LIST_HEAD_INITIALIZER(db_cmd_table);
-static struct command *db_last_command = 0;
+static struct command *db_last_command = NULL;
/*
* if 'ed' style: 'dot' is set at start of last item printed,
@@ -429,7 +429,7 @@ db_command(struct command **last_cmdp, struct command_table *cmd_table,
}
}
*last_cmdp = cmd;
- if (cmd != 0) {
+ if (cmd != NULL) {
/*
* Execute the command.
*/
diff --git a/sys/ddb/db_ps.c b/sys/ddb/db_ps.c
index 76ab2c5..e20b363 100644
--- a/sys/ddb/db_ps.c
+++ b/sys/ddb/db_ps.c
@@ -184,7 +184,8 @@ db_ps(db_expr_t addr, bool hasaddr, db_expr_t count, char *modif)
strlcat(state, "V", sizeof(state));
if (p->p_flag & P_SYSTEM || p->p_lock > 0)
strlcat(state, "L", sizeof(state));
- if (p->p_session != NULL && SESS_LEADER(p))
+ if (p->p_pgrp != NULL && p->p_session != NULL &&
+ SESS_LEADER(p))
strlcat(state, "s", sizeof(state));
/* Cheated here and didn't compare pgid's. */
if (p->p_flag & P_CONTROLT)
diff --git a/sys/ddb/db_sym.c b/sys/ddb/db_sym.c
index ffcba79..25ae4bc 100644
--- a/sys/ddb/db_sym.c
+++ b/sys/ddb/db_sym.c
@@ -395,7 +395,7 @@ db_symbol_values(c_db_sym_t sym, const char **namep, db_expr_t *valuep)
db_expr_t value;
if (sym == DB_SYM_NULL) {
- *namep = 0;
+ *namep = NULL;
return;
}
@@ -438,13 +438,13 @@ db_printsym(db_expr_t off, db_strategy_t strategy)
cursym = db_search_symbol(off, strategy, &d);
db_symbol_values(cursym, &name, &value);
- if (name == 0)
+ if (name == NULL)
value = off;
if (value >= DB_SMALL_VALUE_MIN && value <= DB_SMALL_VALUE_MAX) {
db_printf("%+#lr", (long)off);
return;
}
- if (name == 0 || d >= (unsigned long)db_maxoff) {
+ if (name == NULL || d >= (unsigned long)db_maxoff) {
db_printf("%#lr", (unsigned long)off);
return;
}
OpenPOWER on IntegriCloud