9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: mirtchov@cpsc.ucalgary.ca
To: 9fans@cse.psu.edu, 9trouble@plan9.bell-labs.com
Subject: [9fans] devfs.c and configuration files
Date: Thu, 16 Oct 2003 15:20:12 -0600	[thread overview]
Message-ID: <4a1ac636661a12e0ac4093449e79bc0e@plan9.ucalgary.ca> (raw)

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%




             reply	other threads:[~2003-10-16 21:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-16 21:20 mirtchov [this message]
2003-10-17  0:28 ` andrey mirtchovski
2003-10-17  8:33 ` Fco.J.Ballesteros

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4a1ac636661a12e0ac4093449e79bc0e@plan9.ucalgary.ca \
    --to=mirtchov@cpsc.ucalgary.ca \
    --cc=9fans@cse.psu.edu \
    --cc=9trouble@plan9.bell-labs.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).