9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] devfs.c and configuration files
@ 2003-10-16 21:20 mirtchov
  2003-10-17  0:28 ` andrey mirtchovski
  2003-10-17  8:33 ` Fco.J.Ballesteros
  0 siblings, 2 replies; 3+ messages in thread
From: mirtchov @ 2003-10-16 21:20 UTC (permalink / raw)
  To: 9fans, 9trouble

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%




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [9fans] devfs.c and configuration files
  2003-10-16 21:20 [9fans] devfs.c and configuration files mirtchov
@ 2003-10-17  0:28 ` andrey mirtchovski
  2003-10-17  8:33 ` Fco.J.Ballesteros
  1 sibling, 0 replies; 3+ messages in thread
From: andrey mirtchovski @ 2003-10-17  0:28 UTC (permalink / raw)
  To: 9fans

On Thu, 16 Oct 2003 mirtchov@cpsc.ucalgary.ca wrote:

> > 		error("Bad config: should begin with: fsdev\\n");

should be:
		error("Bad config: should begin with: fsdev:\\n");

I lost the ':' somewhere while translating the message into proper
english...

andrey



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [9fans] devfs.c and configuration files
  2003-10-16 21:20 [9fans] devfs.c and configuration files mirtchov
  2003-10-17  0:28 ` andrey mirtchovski
@ 2003-10-17  8:33 ` Fco.J.Ballesteros
  1 sibling, 0 replies; 3+ messages in thread
From: Fco.J.Ballesteros @ 2003-10-17  8:33 UTC (permalink / raw)
  To: 9fans

[-- Attachment #1: Type: text/plain, Size: 102 bytes --]

I think those bugs are my fault. Sorry.
It seems I exercised a different version of that code, sic.

[-- Attachment #2: Type: message/rfc822, Size: 2744 bytes --]

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
Message-ID: <4a1ac636661a12e0ac4093449e79bc0e@plan9.ucalgary.ca>

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%

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-10-17  8:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-10-16 21:20 [9fans] devfs.c and configuration files mirtchov
2003-10-17  0:28 ` andrey mirtchovski
2003-10-17  8:33 ` Fco.J.Ballesteros

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).