svn commit: r252415 - head/sys/kern

Mateusz Guzik mjg at FreeBSD.org
Sun Jun 30 13:17:37 UTC 2013


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);


More information about the svn-src-all mailing list