Linux-kernel mailing list archive 2000-29,: Re: devfs question

# Re: devfs question

Richard Gooch (rgooch@ras.ucalgary.ca)
Tue, 18 Jul 2000 18:20:07 -0400

- Messages sorted by: [ date ][ thread ][ subject ][ author ]
- Next message: Brian Gerst: "Re: [PATCH] 2.4.0-test5-pre2 preprocessing related fixes"
- Previous message: Rask Ingemann Lambertsen: "Re: pre-patch-2.0.39-6"
- Next in thread: Andrew Pimlott: "Re: devfs question"
- Reply: Andrew Pimlott: "Re: devfs question"

Andrew Pimlott writes:
> On Tue, Jul 18, 2000 at 05:59:12PM -0400, Richard Gooch wrote:
> > Khimenko Victor writes:
>
> > > - if ((tty = rindex(ttyn, '/')))
> > > - ++tty;
> > > + if (strncmp(ttyn, "/dev/", 5) == 0)
> > > + tty = ttyn+5;
> > > else
> >
> > Hm. util-linux-2.10f doesn't have this, 2.10h does. 2.10g isn't on
> > kernel.org.
> >
> > However, you really should have swapped to index(3) instead (or
> > better, strchr(3) which is POSIX). Building an assumption on /dev
> > isn't very good either. It still wouldn't be 100% correct (it'll fall
> > over if your device nodes/devfs mountpoint are deeper), but it would
> > be better.
>
> Perhaps best to look for a purely numerical last component, and in
> that case take the last two components.

That would break the old names. "/dev/tty1" would not match to "tty1".

Regards,

Richard....
Permanent: rgooch@atnf.csiro.au
Current: rgooch@ras.ucalgary.ca

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

- Next message: Brian Gerst: "Re: [PATCH] 2.4.0-test5-pre2 preprocessing related fixes"
- Previous message: Rask Ingemann Lambertsen: "Re: pre-patch-2.0.39-6"
- Next in thread: Andrew Pimlott: "Re: devfs question"
- Reply: Andrew Pimlott: "Re: devfs question"