From 171fc181543e7ac425f46aec98f388d2e7abae0c Mon Sep 17 00:00:00 2001 From: guenther Date: Fri, 28 Aug 2015 04:38:47 +0000 Subject: Rework the UNIX domain socket garbage collector, including ideas from {Free,Net}BSD - when a socket is closed with fds in its input, defer closing them to a task to avoid recursing. This eliminates the complicated extra reference taking which had a 37 line(!) comment explanation - move flags, counts, and links only needed for this from struct file to struct unpcb - document the flow of the mark/sweep collector much help from claudio@ who made me explain the GC to him until we trusted it ok claudio@ mpi@ deraadt@ --- lib/libkvm/kvm_file2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/libkvm') diff --git a/lib/libkvm/kvm_file2.c b/lib/libkvm/kvm_file2.c index bd2ba2b9af8..04912bf2562 100644 --- a/lib/libkvm/kvm_file2.c +++ b/lib/libkvm/kvm_file2.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kvm_file2.c,v 1.45 2015/03/28 23:50:55 bluhm Exp $ */ +/* $OpenBSD: kvm_file2.c,v 1.46 2015/08/28 04:38:47 guenther Exp $ */ /* * Copyright (c) 2009 Todd C. Miller @@ -484,7 +484,6 @@ fill_file(kvm_t *kd, struct kinfo_file *kf, struct file *fp, u_long fpaddr, kf->f_iflags = fp->f_iflags; kf->f_type = fp->f_type; kf->f_count = fp->f_count; - kf->f_msgcount = fp->f_msgcount; kf->f_ucred = PTRTOINT64(fp->f_cred); kf->f_uid = f_cred.cr_uid; kf->f_gid = f_cred.cr_gid; @@ -655,6 +654,7 @@ fill_file(kvm_t *kd, struct kinfo_file *kf, struct file *fp, u_long fpaddr, _kvm_err(kd, kd->program, "can't read unpcb"); return (-1); } + kf->f_msgcount = unpcb.unp_msgcount; kf->unp_conn = PTRTOINT64(unpcb.unp_conn); kf->unp_refs = PTRTOINT64( SLIST_FIRST(&unpcb.unp_refs)); -- cgit v1.2.3-59-g8ed1b