forked from enlightenment/efl
backport some stuff from eeze 1.1:
lots of formatting cleanups move udev extern into private header another filter added to find_by_type to avoid some disks that randomly crop up with MOUNTABLE SVN revision: 53745
This commit is contained in:
parent
ef1b10734e
commit
71ec1ec5a4
|
@ -5,8 +5,6 @@
|
||||||
#include <Eeze.h>
|
#include <Eeze.h>
|
||||||
#include "eeze_udev_private.h"
|
#include "eeze_udev_private.h"
|
||||||
|
|
||||||
extern _udev *udev;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @addtogroup find Find
|
* @addtogroup find Find
|
||||||
*
|
*
|
||||||
|
@ -67,8 +65,9 @@ eeze_udev_find_similar_from_syspath(const char *syspath)
|
||||||
devname = udev_list_entry_get_name(cur);
|
devname = udev_list_entry_get_name(cur);
|
||||||
/* verify unlisted device */
|
/* verify unlisted device */
|
||||||
|
|
||||||
EINA_LIST_FOREACH(ret, l, dev) if (!strcmp(dev, devname))
|
EINA_LIST_FOREACH(ret, l, dev)
|
||||||
continue;
|
if (!strcmp(dev, devname))
|
||||||
|
continue;
|
||||||
|
|
||||||
ret = eina_list_prepend(ret, eina_stringshare_add(devname));
|
ret = eina_list_prepend(ret, eina_stringshare_add(devname));
|
||||||
device = udev_device_new_from_syspath(udev, devname);
|
device = udev_device_new_from_syspath(udev, devname);
|
||||||
|
@ -210,6 +209,8 @@ eeze_udev_find_by_type(Eeze_Udev_Type etype, const char *name)
|
||||||
udev_enumerate_add_match_subsystem(en, "block");
|
udev_enumerate_add_match_subsystem(en, "block");
|
||||||
udev_enumerate_add_match_property(en, "ID_FS_USAGE", "filesystem");
|
udev_enumerate_add_match_property(en, "ID_FS_USAGE", "filesystem");
|
||||||
udev_enumerate_add_nomatch_sysattr(en, "capability", "52");
|
udev_enumerate_add_nomatch_sysattr(en, "capability", "52");
|
||||||
|
/* parent node */
|
||||||
|
udev_enumerate_add_nomatch_sysattr(en, "capability", "50");
|
||||||
break;
|
break;
|
||||||
case EEZE_UDEV_TYPE_DRIVE_INTERNAL:
|
case EEZE_UDEV_TYPE_DRIVE_INTERNAL:
|
||||||
udev_enumerate_add_match_subsystem(en, "block");
|
udev_enumerate_add_match_subsystem(en, "block");
|
||||||
|
@ -274,22 +275,18 @@ eeze_udev_find_by_type(Eeze_Udev_Type etype, const char *name)
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else if (etype == EEZE_UDEV_TYPE_DRIVE_INTERNAL)
|
||||||
if (etype == EEZE_UDEV_TYPE_DRIVE_INTERNAL)
|
|
||||||
{
|
{
|
||||||
if (udev_device_get_property_value(device, "ID_USB_DRIVER"))
|
if (udev_device_get_property_value(device, "ID_USB_DRIVER"))
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
else
|
else if (etype == EEZE_UDEV_TYPE_DRIVE_REMOVABLE)
|
||||||
if (etype == EEZE_UDEV_TYPE_DRIVE_REMOVABLE)
|
|
||||||
{
|
{
|
||||||
if (!
|
if (!(test = udev_device_get_property_value(device, "ID_USB_DRIVER")))
|
||||||
(test = udev_device_get_property_value(device, "ID_USB_DRIVER")))
|
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (name)
|
if (name && (!strstr(devname, name)))
|
||||||
if (!strstr(devname, name))
|
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
ret = eina_list_append(ret, eina_stringshare_add(devname));
|
ret = eina_list_append(ret, eina_stringshare_add(devname));
|
||||||
|
|
|
@ -5,8 +5,6 @@
|
||||||
#include <Eeze.h>
|
#include <Eeze.h>
|
||||||
#include "eeze_udev_private.h"
|
#include "eeze_udev_private.h"
|
||||||
|
|
||||||
extern _udev *udev;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* helper function to set up a new device from a syspath
|
* helper function to set up a new device from a syspath
|
||||||
* which may or may not include /sys at the beginning
|
* which may or may not include /sys at the beginning
|
||||||
|
|
|
@ -5,8 +5,6 @@
|
||||||
#include <Eeze.h>
|
#include <Eeze.h>
|
||||||
#include "eeze_udev_private.h"
|
#include "eeze_udev_private.h"
|
||||||
|
|
||||||
extern _udev *udev;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @addtogroup syspath Syspath
|
* @addtogroup syspath Syspath
|
||||||
*
|
*
|
||||||
|
|
|
@ -5,8 +5,6 @@
|
||||||
#include <Eeze.h>
|
#include <Eeze.h>
|
||||||
#include "eeze_udev_private.h"
|
#include "eeze_udev_private.h"
|
||||||
|
|
||||||
extern _udev *udev;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @addtogroup walks Walks
|
* @addtogroup walks Walks
|
||||||
*
|
*
|
||||||
|
|
|
@ -6,8 +6,6 @@
|
||||||
#include <Eeze.h>
|
#include <Eeze.h>
|
||||||
#include "eeze_udev_private.h"
|
#include "eeze_udev_private.h"
|
||||||
|
|
||||||
extern _udev *udev;
|
|
||||||
|
|
||||||
/* opaque */
|
/* opaque */
|
||||||
struct Eeze_Udev_Watch
|
struct Eeze_Udev_Watch
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue