diff options
author | araujo <araujo@FreeBSD.org> | 2016-04-19 01:25:35 +0000 |
---|---|---|
committer | araujo <araujo@FreeBSD.org> | 2016-04-19 01:25:35 +0000 |
commit | 01b939b5430497c798bf0a9da3f7d030fd48aacb (patch) | |
tree | 280b49204f2f7a55e6bd0b40751da7e374b52a93 /sbin/init | |
parent | a7ef04a9b95476945ee528fb8f958da7a6cf0d9e (diff) | |
download | FreeBSD-src-01b939b5430497c798bf0a9da3f7d030fd48aacb.zip FreeBSD-src-01b939b5430497c798bf0a9da3f7d030fd48aacb.tar.gz |
Use NULL instead of 0 for pointers.
dbopen(3) will returns a NULL on error.
MFC after: 2 weeks.
Diffstat (limited to 'sbin/init')
-rw-r--r-- | sbin/init/init.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sbin/init/init.c b/sbin/init/init.c index 0827f33..0070990 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); |