[PATCH] add soundcard device and fix device_file handling
Danny Kukawka
danny.kukawka at web.de
Tue Mar 20 04:16:32 PDT 2007
On Dienstag, 20. März 2007, Danny Kukawka wrote:
> On Dienstag, 20. März 2007, David Zeuthen wrote:
> > On Mon, 2007-03-19 at 15:41 +0100, Danny Kukawka wrote:
> > > Hi,
> > >
> > > this patch fixes these issues:
> > > * change checks for empty device file path from 'device_file == NULL'
> > > to 'device_file[0] == '\0'' since the device_file path is currently
> > > never NULL but '\0' if empty/unset.
> >
> > Should probably stil check for device_file != NULL before looking at the
> > first character...
>
> IMO this is not needed because the coldplug code already do this:
>
> no_node:
> if (hotplug_event->sysfs.device_file[0] == '\0')
> HAL_INFO (("new event (no dev node) '%s'", sysfs_path));
>
> But I can add this really paranoid check.
Hm ... make no sense to add such a checj since hotplug_event->sysfs.device_file
is a char array and can't be NULL:
hotplug.c:
------------------------------------
union {
struct {
char subsystem[HAL_NAME_MAX];
/* Kernel subsystem the device belongs to */
char sysfs_path[HAL_PATH_MAX];
/* Kernel device devpath */
------------------------------------
Danny
More information about the hal
mailing list