Author: trasz
Date: Thu May 26 18:54:07 2011
New Revision: 222320
URL: http://svn.freebsd.org/changeset/base/222320

Log:
  Fix support for RACCT_CORE by merging forgotten file.

Modified:
  head/sys/kern/kern_sig.c

Modified: head/sys/kern/kern_sig.c
==============================================================================
--- head/sys/kern/kern_sig.c    Thu May 26 18:22:49 2011        (r222319)
+++ head/sys/kern/kern_sig.c    Thu May 26 18:54:07 2011        (r222320)
@@ -61,6 +61,7 @@ __FBSDID("$FreeBSD$");
 #include <sys/proc.h>
 #include <sys/posix4.h>
 #include <sys/pioctl.h>
+#include <sys/racct.h>
 #include <sys/resourcevar.h>
 #include <sys/sdt.h>
 #include <sys/sbuf.h>
@@ -3173,14 +3174,15 @@ coredump(struct thread *td)
         * if it is larger than the limit.
         */
        limit = (off_t)lim_cur(p, RLIMIT_CORE);
-       PROC_UNLOCK(p);
-       if (limit == 0) {
+       if (limit == 0 || racct_get_available(p, RACCT_CORE) == 0) {
+               PROC_UNLOCK(p);
 #ifdef AUDIT
                audit_proc_coredump(td, name, EFBIG);
 #endif
                free(name, M_TEMP);
                return (EFBIG);
        }
+       PROC_UNLOCK(p);
 
 restart:
        NDINIT(&nd, LOOKUP, NOFOLLOW | MPSAFE, UIO_SYSSPACE, name, td);
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to