Age | Commit message (Collapse) | Author |
|
Here we replace the various fgets() with a mmap() call for the config
file reading, due to the reported performance problems with klibc.
Thanks to Patrick's testing, it makes a very small, close to nothing
speed gain for libc users, but a 6 times speed increase for klibc users
with a 1000 line config file.
I've created a udev_lib.[hc] for this and also moved all the generic
stuff from udev.h in there and uninlined the functions.
|
|
Hey, I wrote the strn*() macros just 10 days ago and yesterday this trap
caught me with the %c{x} bug.
The names are misleading cause we all expect that the from field is limited by
the size argument, but we actually limit the overall size of the destination
string to prevent a overflow.
Here we rename all strn*() macros to str*max(). That should be
more self-explanatory.
|
|
As promised, here is the next round. We provide in addition to the
already used macros:
strfieldcpy(to, from)
strfieldcat(to, from)
the corresponding friends, if the size of the target is not known and
must be provided by the caller:
strnfieldcpy(to, from, maxsize)
strnfieldcat(to, from, maxsize)
and switch nearly all possibly unsafe users of strcat(), strncat(),
strcpy() and strncpy() to these safer macros.
The last known remaining issue seems the use of sprintf() and
snprintf(). I will take on it later today or tomorrow.
|
|
external one.
Should fix some more build bugs...
|
|
Use the new location of libsysfs header files.
|
|
happy.
Actually, I'm happy to, startup time is much smaller...
|
|
Also introduce boolean type for config file to use.
|
|
Once again, patch to make logging a config option.
Reason for this (since you asked for it):
- In our setup it is easy (although still annoying) .. just edit the
ebuild, add logging support (or remove it) and rebuild. For say a
binary distro, having the logging is useful for debugging some
times, but its more a once of, or rare thing, as you do not add or
change config files every day. Sure, we can have logging by
default, but many do not want ~300 lines of extra debugging in their
logs is not pleasant, and they will complain. Rebuilding the
package for that binary package (given the users it is targeted to)
is usually not within most users grasp.
|
|
namedev.o
|
|
I've edited the man page today, so this is alreay included :)
Also a few more trivials:
o added the defaults to udev.conf.in
o removed class_dev from get_default_mode(), to match with Hanna's
o changed size of mode_str to MODE_SIZE
o changed a few char compares from from 0x00 to '\0'
|
|
This patch fixes a bug where the udev database stored empty strings
for Owner and Group if they were default. This patch stores the default
value into the database if not set otherwise. See example output:
crw------- 1 root root 4, 65 Jan 16 11:13 ttyS1
P: /class/tty/ttyS1
N: ttyS1
S:
O: root
G: root
This is a bit of a hack. However, until udev supports setting the
o/g values they will be root/root anyway so the database might as
well reflect the truth instead of empty strings.
|
|
On Thu, Jan 15, 2004 at 05:14:16AM +0100, Kay Sievers wrote:
> On Wed, Jan 14, 2004 at 01:10:43PM -0800, Greg KH wrote:
> > On Wed, Jan 14, 2004 at 02:34:26PM -0600, Clay Haapala wrote:
> > > On Wed, 14 Jan 2004, Chris Friesen spake thusly:
> > > >
> > > > Maybe for ones with a matching rule, you could print something like:
> > > >
> > > >
> > > Is the act of printing/syslogging a rule in an of itself?
> >
> > No, as currently the only way stuff ends up in the syslog is if
> > DEBUG=true is used on the build line.
> >
> > But it's sounding like we might want to change that... :)
>
> How about this in the syslog after connect/disconnect?
>
> Jan 15 05:07:45 pim udev[28007]: configured rule in '/etc/udev/udev.rules' at line 17 applied, 'video*' becomes 'video/webcam%n'
> Jan 15 05:07:45 pim udev[28007]: creating device node '/udev/video/webcam0'
> Jan 15 05:07:47 pim udev[28015]: removing device node '/udev/video/webcam0'
Here is a slightly better version. I've created a logging.h file and
moved the debug macros from udev.h in there.
If you type:
'make' - you will get a binary that prints one or two lines to syslog
if a device node is created or deleted
'make LOG=false' - you get a binary that prints asolutely nothing
'make DEBUG=true' - the same as today, it will print all debug lines
|
|
Now there are only 3 valid environment test variables. The rest can be
specified with the config file.
|
|
the older udev.config file is now called udev.rules.
This allows us to better control configuration values, and move away from
the environment variables.
|