Author: mjg
Date: Sun Jun 30 13:17:37 2013
New Revision: 252415
URL: http://svnweb.freebsd.org/changeset/base/252415

Log:
  acct: reduce code duplication by using acct_disable as cleanup for
  failed kproc_create
  
  MFC after:    1 week

Modified:
  head/sys/kern/kern_acct.c

Modified: head/sys/kern/kern_acct.c
==============================================================================
--- head/sys/kern/kern_acct.c   Sun Jun 30 13:14:46 2013        (r252414)
+++ head/sys/kern/kern_acct.c   Sun Jun 30 13:17:37 2013        (r252415)
@@ -284,12 +284,7 @@ sys_acct(struct thread *td, struct acct_
                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);
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to