From mboxrd@z Thu Jan 1 00:00:00 1970 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 Date: Thu, 16 Oct 2003 15:20:12 -0600 Topicbox-Message-UUID: 6fa706a4-eacc-11e9-9e20-41e7f4b1d025 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%