acct: reduce code duplication by using acct_disable as cleanup for

failed kproc_create

MFC after:	1 week
This commit is contained in:
Mateusz Guzik 2013-06-30 13:17:37 +00:00
parent 8f99c21f94
commit 4a3c4f41e9
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=252415

View File

@ -284,12 +284,7 @@ sys_acct(struct thread *td, struct acct_args *uap)
error = kproc_create(acct_thread, NULL, NULL, 0, 0,
"accounting");
if (error) {
(void) vn_close(acct_vp, acct_flags, acct_cred, td);
crfree(acct_cred);
acct_configured = 0;
acct_vp = NULL;
acct_cred = NULL;
acct_flags = 0;
(void) acct_disable(td, 0);
sx_xunlock(&acct_sx);
log(LOG_NOTICE, "Unable to start accounting thread\n");
return (error);