aboutsummaryrefslogtreecommitdiff
path: root/sbin/init
diff options
context:
space:
mode:
authorMarcelo Araujo <araujo@FreeBSD.org>2016-04-19 01:25:35 +0000
committerMarcelo Araujo <araujo@FreeBSD.org>2016-04-19 01:25:35 +0000
commit14adaa14cbefae00899f2d4d942a25cd5c11ea5d (patch)
tree280b49204f2f7a55e6bd0b40751da7e374b52a93 /sbin/init
parent0b410d9c570e4c5af73425d136042e0682988df7 (diff)
downloadsrc-14adaa14cbefae00899f2d4d942a25cd5c11ea5d.tar.gz
src-14adaa14cbefae00899f2d4d942a25cd5c11ea5d.zip
Use NULL instead of 0 for pointers.
dbopen(3) will returns a NULL on error. MFC after: 2 weeks.
Notes
Notes: svn path=/head/; revision=298236
Diffstat (limited to 'sbin/init')
-rw-r--r--sbin/init/init.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sbin/init/init.c b/sbin/init/init.c
index 0827f33232f2..0070990aeecb 100644
--- a/sbin/init/init.c
+++ b/sbin/init/init.c
@@ -1144,7 +1144,7 @@ start_session_db(void)
{
if (session_db && (*session_db->close)(session_db))
emergency("session database close: %s", strerror(errno));
- if ((session_db = dbopen(NULL, O_RDWR, 0, DB_HASH, NULL)) == 0) {
+ if ((session_db = dbopen(NULL, O_RDWR, 0, DB_HASH, NULL)) == NULL) {
emergency("session database open: %s", strerror(errno));
return (1);
}
@@ -1284,7 +1284,7 @@ new_session(session_t *sprev, struct ttyent *typ)
}
sp->se_next = 0;
- if (sprev == 0) {
+ if (sprev == NULL) {
sessions = sp;
sp->se_prev = 0;
} else {
@@ -1311,7 +1311,7 @@ setupargv(session_t *sp, struct ttyent *typ)
sprintf(sp->se_getty, "%s %s", typ->ty_getty, typ->ty_name);
sp->se_getty_argv_space = strdup(sp->se_getty);
sp->se_getty_argv = construct_argv(sp->se_getty_argv_space);
- if (sp->se_getty_argv == 0) {
+ if (sp->se_getty_argv == NULL) {
warning("can't parse getty for port %s", sp->se_device);
free(sp->se_getty);
free(sp->se_getty_argv_space);
@@ -1329,7 +1329,7 @@ setupargv(session_t *sp, struct ttyent *typ)
sp->se_window = strdup(typ->ty_window);
sp->se_window_argv_space = strdup(sp->se_window);
sp->se_window_argv = construct_argv(sp->se_window_argv_space);
- if (sp->se_window_argv == 0) {
+ if (sp->se_window_argv == NULL) {
warning("can't parse window for port %s",
sp->se_device);
free(sp->se_window_argv_space);