From owner-freebsd-current@FreeBSD.ORG Fri Jul 27 23:14:34 2007 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ACBAF16A418 for ; Fri, 27 Jul 2007 23:14:34 +0000 (UTC) (envelope-from maksim.yevmenkin@gmail.com) Received: from py-out-1112.google.com (py-out-1112.google.com [64.233.166.181]) by mx1.freebsd.org (Postfix) with ESMTP id 6183C13C491 for ; Fri, 27 Jul 2007 23:14:34 +0000 (UTC) (envelope-from maksim.yevmenkin@gmail.com) Received: by py-out-1112.google.com with SMTP id a73so1940339pye for ; Fri, 27 Jul 2007 16:14:33 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=Y9plWmNTXQcZCjyl/uQDWXnmQjc6+t7cMn2v89No7eh5nqZUmcpvc5VS9CK7S0JgmdiXFdhR+yX/LC42PgsE3JBHQ2VmXI5zeMwBN+be/BWs8bu1WpmH1gGzC20fNahD/Z/rNnmxKrZA6zhg/h84hjn94qs3kPeAlIOZ2PgDCaM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=t69H7IrklRoXppAopBx4ABuRv/1m470QM1/KSFB1WVss5T544LR/vH+U2KfatjNM9MbpX6ddi2hOVjXt8NO5KTJaRUDUbMy4pO0op7k8EhjJYV92mTp1KZ4jcbz5c9c9PiKaHLI26YyajCO7atU7J6UqfHqHqLeue0QharbzEJs= Received: by 10.65.59.11 with SMTP id m11mr5867046qbk.1185578073664; Fri, 27 Jul 2007 16:14:33 -0700 (PDT) Received: by 10.65.234.10 with HTTP; Fri, 27 Jul 2007 16:14:33 -0700 (PDT) Message-ID: Date: Fri, 27 Jul 2007 16:14:33 -0700 From: "Maksim Yevmenkin" To: "Julian Elischer" In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <46A94194.5010207@elischer.org> Cc: freebsd-current@freebsd.org Subject: Re: nmdm(4) does not call .l_close X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jul 2007 23:14:34 -0000 On 7/27/07, Maksim Yevmenkin wrote: > On 7/26/07, Julian Elischer wrote: > > Maksim Yevmenkin wrote: > > > Dear All, > > > > > > it seems to me that nmdm(4) is not calling .l_close (i.e. does not > > > close whatever line discipline might be installed onto /dev/nmdmXX). > > > the problem is easy to reproduce - just open /dev/nmdm0A and install, > > > say, ng_tty(4) line discipline onto it. after that, simply close the > > > /dev/nmdm0A. in theory, the ng_tty(4) node should disappear when > > > device is closed, but it does not. > > [...] > i have not tried other disciplines yet, i.e. ppp and slip, ok, i changed the patch to === diff -u nmdm.c.orig nmdm.c --- nmdm.c.orig 2006-11-21 16:59:40.000000000 -0800 +++ nmdm.c 2007-07-27 15:57:50.000000000 -0700 @@ -401,8 +401,13 @@ static int nmdmclose(struct cdev *dev, int flag, int mode, struct thread *td) { + struct tty *tp = dev->si_tty; + int error; - return (tty_close(dev->si_tty)); + error = ttyld_close(tp, flag); + (void) tty_close(tp); + + return (error); } static void === and tried it with h4, ppp and slip line disciplines. it seems to work. since nmdmopen() calls ttyld_open(), nmdmclose(), imo, should call ttyld_close(). any comments? thanks, max