From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <227d4bf857cdaf8ae57e31d63cc18579@plan9.escet.urjc.es> To: 9fans@cse.psu.edu Subject: Re: [9fans] devfs.c and configuration files From: Fco.J.Ballesteros In-Reply-To: <4a1ac636661a12e0ac4093449e79bc0e@plan9.ucalgary.ca> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="upas-lqnthwuzsbjhjyldhxcobbxqvm" Date: Fri, 17 Oct 2003 10:33:42 +0200 Topicbox-Message-UUID: 6fdc5246-eacc-11e9-9e20-41e7f4b1d025 This is a multi-part message in MIME format. --upas-lqnthwuzsbjhjyldhxcobbxqvm Content-Disposition: inline Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit I think those bugs are my fault. Sorry. It seems I exercised a different version of that code, sic. --upas-lqnthwuzsbjhjyldhxcobbxqvm Content-Type: message/rfc822 Content-Disposition: inline Received: from mail.cse.psu.edu ([130.203.4.6]) by aquamar; Thu Oct 16 23:22:42 MDT 2003 Received: by mail.cse.psu.edu (CSE Mail Server, from userid 60001) id AB80A19AD5; Thu, 16 Oct 2003 17:22:36 -0400 (EDT) Received: from psuvax1.cse.psu.edu (psuvax1.cse.psu.edu [130.203.20.6]) by mail.cse.psu.edu (CSE Mail Server) with ESMTP id AB82E19AFE; Thu, 16 Oct 2003 17:22:14 -0400 (EDT) X-Original-To: 9fans@cse.psu.edu Delivered-To: 9fans@cse.psu.edu Received: by mail.cse.psu.edu (CSE Mail Server, from userid 60001) id 8AB6619ADC; Thu, 16 Oct 2003 17:21:01 -0400 (EDT) Received: from plan9.ucalgary.ca (unknown [136.159.220.110]) by mail.cse.psu.edu (CSE Mail Server) with ESMTP id 9D9F819A88 for <9fans@cse.psu.edu>; Thu, 16 Oct 2003 17:20:49 -0400 (EDT) Message-ID: <4a1ac636661a12e0ac4093449e79bc0e@plan9.ucalgary.ca> To: 9fans@cse.psu.edu, 9trouble@plan9.bell-labs.com From: mirtchov@cpsc.ucalgary.ca MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: [9fans] devfs.c and configuration files Sender: 9fans-admin@cse.psu.edu Errors-To: 9fans-admin@cse.psu.edu X-BeenThere: 9fans@cse.psu.edu X-Mailman-Version: 2.0.11 Precedence: bulk Reply-To: 9fans@cse.psu.edu List-Id: Fans of the OS Plan 9 from Bell Labs <9fans.cse.psu.edu> List-Archive: Date: Thu, 16 Oct 2003 15:20:12 -0600 X-Spam-Status: No, hits=0.8 required=5.0 tests=NO_REAL_NAME version=2.55 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.55 (1.174.2.19-2003-05-19-exp) I tried putting the devfs configuration on disk, but ran into major problems reading it back from there. The diff included fixes a few of those: 1. The config file _must_ begin with "fsdev:\n". This feature is undocumented and not really necessary -- for example it makes the man page example cp /dev/fs/ctl /dev/fd0disk not work at all. I've left it in because I don't know why it was there in the first place. 2. A double free in rdconf() 3. The parser doesn't deal with empty lines -- it will flag an error, the error handling routine will sed 'configed = 1', so the next "bind -a '#k' /dev" will work, just not the first one. We all know how important it is for other Plan 9 utilities that configuration files and scripts end in a newline, so I've changed it to handle it properly. andrey ------ plan9% yesterday -d /sys/src/9/port/devfs.c diff /n/dump/2003/1016/sys/src/9/port/devfs.c /sys/src/9/port/devfs.c 270c270 < error("Bad config"); --- > error("Bad config: should begin with: fsdev\\n"); 276a277,280 > if (e == p) { > e++; > continue; > } 280d283 < free(s); plan9% --upas-lqnthwuzsbjhjyldhxcobbxqvm--