[PATCH] overall whitespace + debug text conditioning
01-overall-whitespace+debug-text-conditioning.diff o cleanup whitespace o clarify a few comments o enclose all printed debug string values in ''
This commit is contained in:
parent
74894b53f8
commit
f7b4eca455
14
logging.c
14
logging.c
|
@ -32,26 +32,26 @@
|
||||||
static int logging_init = 0;
|
static int logging_init = 0;
|
||||||
static unsigned char udev_logname[42];
|
static unsigned char udev_logname[42];
|
||||||
|
|
||||||
static void init_logging (void)
|
static void init_logging(void)
|
||||||
{
|
{
|
||||||
snprintf(udev_logname,42,"udev[%d]", getpid());
|
snprintf(udev_logname, 42,"udev[%d]", getpid());
|
||||||
|
|
||||||
openlog (udev_logname, 0, LOG_DAEMON);
|
openlog(udev_logname, 0, LOG_DAEMON);
|
||||||
logging_init = 1;
|
logging_init = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* log_message - sends a message to the logging facility
|
* log_message - sends a message to the logging facility
|
||||||
*/
|
*/
|
||||||
int log_message (int level, const char *format, ...)
|
int log_message(int level, const char *format, ...)
|
||||||
{
|
{
|
||||||
va_list args;
|
va_list args;
|
||||||
|
|
||||||
if (!logging_init)
|
if (!logging_init)
|
||||||
init_logging();
|
init_logging();
|
||||||
va_start (args, format);
|
va_start(args, format);
|
||||||
vsyslog (level, format, args);
|
vsyslog(level, format, args);
|
||||||
va_end (args);
|
va_end(args);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
30
namedev.c
30
namedev.c
|
@ -216,10 +216,10 @@ static int namedev_init_config(void)
|
||||||
int retval = 0;
|
int retval = 0;
|
||||||
struct config_device dev;
|
struct config_device dev;
|
||||||
|
|
||||||
dbg("opening %s to read as config", udev_config_filename);
|
dbg("opening '%s' to read as config", udev_config_filename);
|
||||||
fd = fopen(udev_config_filename, "r");
|
fd = fopen(udev_config_filename, "r");
|
||||||
if (fd == NULL) {
|
if (fd == NULL) {
|
||||||
dbg("can't open %s", udev_config_filename);
|
dbg("can't open '%s'", udev_config_filename);
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -232,7 +232,7 @@ static int namedev_init_config(void)
|
||||||
goto exit;
|
goto exit;
|
||||||
lineno++;
|
lineno++;
|
||||||
|
|
||||||
dbg_parse("read %s", temp);
|
dbg_parse("read '%s'", temp);
|
||||||
|
|
||||||
/* eat the whitespace at the beginning of the line */
|
/* eat the whitespace at the beginning of the line */
|
||||||
while (isspace(*temp))
|
while (isspace(*temp))
|
||||||
|
@ -413,10 +413,10 @@ static int namedev_init_permissions(void)
|
||||||
int retval = 0;
|
int retval = 0;
|
||||||
struct config_device dev;
|
struct config_device dev;
|
||||||
|
|
||||||
dbg("opening %s to read as permissions config", udev_config_permission_filename);
|
dbg("opening '%s' to read as permissions config", udev_config_permission_filename);
|
||||||
fd = fopen(udev_config_permission_filename, "r");
|
fd = fopen(udev_config_permission_filename, "r");
|
||||||
if (fd == NULL) {
|
if (fd == NULL) {
|
||||||
dbg("can't open %s", udev_config_permission_filename);
|
dbg("can't open '%s'", udev_config_permission_filename);
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -426,7 +426,7 @@ static int namedev_init_permissions(void)
|
||||||
if (temp == NULL)
|
if (temp == NULL)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
dbg_parse("read %s", temp);
|
dbg_parse("read '%s'", temp);
|
||||||
|
|
||||||
/* eat the whitespace at the beginning of the line */
|
/* eat the whitespace at the beginning of the line */
|
||||||
while (isspace(*temp))
|
while (isspace(*temp))
|
||||||
|
@ -445,21 +445,21 @@ static int namedev_init_permissions(void)
|
||||||
/* parse the line */
|
/* parse the line */
|
||||||
temp2 = strsep(&temp, ":");
|
temp2 = strsep(&temp, ":");
|
||||||
if (!temp2) {
|
if (!temp2) {
|
||||||
dbg("cannot parse line: %s", line);
|
dbg("cannot parse line '%s'", line);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
strncpy(dev.name, temp2, sizeof(dev.name));
|
strncpy(dev.name, temp2, sizeof(dev.name));
|
||||||
|
|
||||||
temp2 = strsep(&temp, ":");
|
temp2 = strsep(&temp, ":");
|
||||||
if (!temp2) {
|
if (!temp2) {
|
||||||
dbg("cannot parse line: %s", line);
|
dbg("cannot parse line '%s'", line);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
strncpy(dev.owner, temp2, sizeof(dev.owner));
|
strncpy(dev.owner, temp2, sizeof(dev.owner));
|
||||||
|
|
||||||
temp2 = strsep(&temp, ":");
|
temp2 = strsep(&temp, ":");
|
||||||
if (!temp2) {
|
if (!temp2) {
|
||||||
dbg("cannot parse line: %s", line);
|
dbg("cannot parse line '%s'", line);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
strncpy(dev.group, temp2, sizeof(dev.owner));
|
strncpy(dev.group, temp2, sizeof(dev.owner));
|
||||||
|
@ -496,7 +496,7 @@ static void build_kernel_number(struct sysfs_class_device *class_dev, struct ude
|
||||||
while (isdigit(*(dig-1)))
|
while (isdigit(*(dig-1)))
|
||||||
dig--;
|
dig--;
|
||||||
strfieldcpy(udev->kernel_number, dig);
|
strfieldcpy(udev->kernel_number, dig);
|
||||||
dbg("kernel_number = %s", udev->kernel_number);
|
dbg("kernel_number='%s'", udev->kernel_number);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void apply_format(struct udevice *udev, unsigned char *string)
|
static void apply_format(struct udevice *udev, unsigned char *string)
|
||||||
|
@ -608,7 +608,7 @@ static int exec_callout(struct config_device *dev, char *value, int len)
|
||||||
break;
|
break;
|
||||||
buffer[res] = '\0';
|
buffer[res] = '\0';
|
||||||
if (res > len) {
|
if (res > len) {
|
||||||
dbg("callout len %d too short\n", len);
|
dbg("callout len %d too short", len);
|
||||||
retval = -1;
|
retval = -1;
|
||||||
}
|
}
|
||||||
if (value_set) {
|
if (value_set) {
|
||||||
|
@ -660,7 +660,7 @@ static int do_callout(struct sysfs_class_device *class_dev, struct udevice *udev
|
||||||
strfieldcpy(udev->group, dev->group);
|
strfieldcpy(udev->group, dev->group);
|
||||||
}
|
}
|
||||||
dbg_parse("callout returned matching value '%s', '%s' becomes '%s'"
|
dbg_parse("callout returned matching value '%s', '%s' becomes '%s'"
|
||||||
" - owner='%s', group='%s', mode =%#o",
|
" - owner='%s', group='%s', mode=%#o",
|
||||||
dev->id, class_dev->name, udev->name,
|
dev->id, class_dev->name, udev->name,
|
||||||
dev->owner, dev->group, dev->mode);
|
dev->owner, dev->group, dev->mode);
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -884,11 +884,11 @@ static int get_attr(struct sysfs_class_device *class_dev, struct udevice *udev)
|
||||||
* up in the kernel...
|
* up in the kernel...
|
||||||
*/
|
*/
|
||||||
if (strstr(class_dev->path, "block")) {
|
if (strstr(class_dev->path, "block")) {
|
||||||
dbg_parse("looking at block device...");
|
dbg_parse("looking at block device");
|
||||||
if (isdigit(class_dev->path[strlen(class_dev->path)-1])) {
|
if (isdigit(class_dev->path[strlen(class_dev->path)-1])) {
|
||||||
char path[SYSFS_PATH_MAX];
|
char path[SYSFS_PATH_MAX];
|
||||||
|
|
||||||
dbg_parse("really is a partition...");
|
dbg_parse("really is a partition");
|
||||||
strfieldcpy(path, class_dev->path);
|
strfieldcpy(path, class_dev->path);
|
||||||
temp = strrchr(path, '/');
|
temp = strrchr(path, '/');
|
||||||
*temp = 0x00;
|
*temp = 0x00;
|
||||||
|
@ -897,7 +897,7 @@ static int get_attr(struct sysfs_class_device *class_dev, struct udevice *udev)
|
||||||
if (class_dev_parent == NULL) {
|
if (class_dev_parent == NULL) {
|
||||||
dbg("sysfs_open_class_device at '%s' failed", path);
|
dbg("sysfs_open_class_device at '%s' failed", path);
|
||||||
} else {
|
} else {
|
||||||
dbg_parse("class_dev_parent->name=%s", class_dev_parent->name);
|
dbg_parse("class_dev_parent->name='%s'", class_dev_parent->name);
|
||||||
if (class_dev_parent->sysdevice)
|
if (class_dev_parent->sysdevice)
|
||||||
sysfs_device = class_dev_parent->sysdevice;
|
sysfs_device = class_dev_parent->sysdevice;
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,7 +50,6 @@ struct config_device {
|
||||||
struct list_head node;
|
struct list_head node;
|
||||||
|
|
||||||
enum config_type type;
|
enum config_type type;
|
||||||
|
|
||||||
char bus[BUS_SIZE];
|
char bus[BUS_SIZE];
|
||||||
char sysfs_file[FILE_SIZE];
|
char sysfs_file[FILE_SIZE];
|
||||||
char sysfs_value[VALUE_SIZE];
|
char sysfs_value[VALUE_SIZE];
|
||||||
|
@ -58,7 +57,7 @@ struct config_device {
|
||||||
char place[PLACE_SIZE];
|
char place[PLACE_SIZE];
|
||||||
char kernel_name[NAME_SIZE];
|
char kernel_name[NAME_SIZE];
|
||||||
char exec_program[FILE_SIZE];
|
char exec_program[FILE_SIZE];
|
||||||
|
|
||||||
/* what to set the device to */
|
/* what to set the device to */
|
||||||
char name[NAME_SIZE];
|
char name[NAME_SIZE];
|
||||||
char owner[OWNER_SIZE];
|
char owner[OWNER_SIZE];
|
||||||
|
|
22
udev-add.c
22
udev-add.c
|
@ -60,12 +60,12 @@ static int get_major_minor(struct sysfs_class_device *class_dev, struct udevice
|
||||||
if (dev == NULL)
|
if (dev == NULL)
|
||||||
goto exit;
|
goto exit;
|
||||||
|
|
||||||
dbg("dev = %s", dev);
|
dbg("dev='%s'", dev);
|
||||||
|
|
||||||
if (sscanf(dev, "%u:%u", &udev->major, &udev->minor) != 2)
|
if (sscanf(dev, "%u:%u", &udev->major, &udev->minor) != 2)
|
||||||
goto exit;
|
goto exit;
|
||||||
|
|
||||||
dbg("found major = %d, minor = %d", udev->major, udev->minor);
|
dbg("found major=%d, minor=%d", udev->major, udev->minor);
|
||||||
|
|
||||||
retval = 0;
|
retval = 0;
|
||||||
exit:
|
exit:
|
||||||
|
@ -129,7 +129,7 @@ static int create_node(struct udevice *dev)
|
||||||
path, strerror(errno));
|
path, strerror(errno));
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
dbg("created %s", path);
|
dbg("created '%s'", path);
|
||||||
}
|
}
|
||||||
*pos = '/';
|
*pos = '/';
|
||||||
}
|
}
|
||||||
|
@ -155,7 +155,7 @@ static int create_node(struct udevice *dev)
|
||||||
else {
|
else {
|
||||||
struct passwd *pw = getpwnam(dev->owner);
|
struct passwd *pw = getpwnam(dev->owner);
|
||||||
if (!pw)
|
if (!pw)
|
||||||
dbg("user unknown: %s", dev->owner);
|
dbg("user unknown '%s'", dev->owner);
|
||||||
else
|
else
|
||||||
uid = pw->pw_uid;
|
uid = pw->pw_uid;
|
||||||
}
|
}
|
||||||
|
@ -169,7 +169,7 @@ static int create_node(struct udevice *dev)
|
||||||
else {
|
else {
|
||||||
struct group *gr = getgrnam(dev->group);
|
struct group *gr = getgrnam(dev->group);
|
||||||
if (!gr)
|
if (!gr)
|
||||||
dbg("group unknown: %s", dev->group);
|
dbg("group unknown '%s'", dev->group);
|
||||||
else
|
else
|
||||||
gid = gr->gr_gid;
|
gid = gr->gr_gid;
|
||||||
}
|
}
|
||||||
|
@ -194,7 +194,7 @@ static struct sysfs_class_device *get_class_dev(char *device_name)
|
||||||
strcpy(dev_path, sysfs_path);
|
strcpy(dev_path, sysfs_path);
|
||||||
strcat(dev_path, device_name);
|
strcat(dev_path, device_name);
|
||||||
|
|
||||||
dbg("looking at %s", dev_path);
|
dbg("looking at '%s'", dev_path);
|
||||||
|
|
||||||
/* open up the sysfs class device for this thing... */
|
/* open up the sysfs class device for this thing... */
|
||||||
class_dev = sysfs_open_class_device(dev_path);
|
class_dev = sysfs_open_class_device(dev_path);
|
||||||
|
@ -202,7 +202,7 @@ static struct sysfs_class_device *get_class_dev(char *device_name)
|
||||||
dbg ("sysfs_open_class_device failed");
|
dbg ("sysfs_open_class_device failed");
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
dbg("class_dev->name = %s", class_dev->name);
|
dbg("class_dev->name='%s'", class_dev->name);
|
||||||
|
|
||||||
exit:
|
exit:
|
||||||
return class_dev;
|
return class_dev;
|
||||||
|
@ -225,13 +225,12 @@ static int sleep_for_dev(char *path)
|
||||||
while (loop--) {
|
while (loop--) {
|
||||||
struct stat buf;
|
struct stat buf;
|
||||||
|
|
||||||
dbg("looking for %s", filename);
|
dbg("looking for '%s'", filename);
|
||||||
retval = stat(filename, &buf);
|
retval = stat(filename, &buf);
|
||||||
if (!retval)
|
if (!retval)
|
||||||
goto exit;
|
goto exit;
|
||||||
|
|
||||||
/* sleep for a second or two to give the kernel a chance to
|
/* sleep to give the kernel a chance to create the dev file */
|
||||||
* create the dev file */
|
|
||||||
sleep(1);
|
sleep(1);
|
||||||
}
|
}
|
||||||
retval = -ENODEV;
|
retval = -ENODEV;
|
||||||
|
@ -276,7 +275,7 @@ int udev_add_device(char *path, char *subsystem)
|
||||||
dbg("udevdb_add_dev failed, but we are going to try to create the node anyway. "
|
dbg("udevdb_add_dev failed, but we are going to try to create the node anyway. "
|
||||||
"But remove might not work properly for this device.");
|
"But remove might not work properly for this device.");
|
||||||
|
|
||||||
dbg("name = %s", dev.name);
|
dbg("name='%s'", dev.name);
|
||||||
retval = create_node(&dev);
|
retval = create_node(&dev);
|
||||||
|
|
||||||
exit:
|
exit:
|
||||||
|
@ -285,4 +284,3 @@ exit:
|
||||||
|
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -52,14 +52,14 @@ static char *get_name(char *path, int major, int minor)
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
dbg("%s not found in database, falling back on default name", path);
|
dbg("'%s' not found in database, falling back on default name", path);
|
||||||
temp = strrchr(path, '/');
|
temp = strrchr(path, '/');
|
||||||
if (temp == NULL)
|
if (temp == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
strncpy(name, &temp[1], sizeof(name));
|
strncpy(name, &temp[1], sizeof(name));
|
||||||
|
|
||||||
exit:
|
exit:
|
||||||
dbg("name is %s", name);
|
dbg("name is '%s'", name);
|
||||||
return &name[0];
|
return &name[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -74,7 +74,7 @@ static int delete_node(char *name)
|
||||||
strncpy(filename, udev_root, sizeof(filename));
|
strncpy(filename, udev_root, sizeof(filename));
|
||||||
strncat(filename, name, sizeof(filename));
|
strncat(filename, name, sizeof(filename));
|
||||||
|
|
||||||
dbg("unlinking %s", filename);
|
dbg("unlinking '%s'", filename);
|
||||||
retval = unlink(filename);
|
retval = unlink(filename);
|
||||||
if (retval) {
|
if (retval) {
|
||||||
dbg("unlink(%s) failed with error '%s'",
|
dbg("unlink(%s) failed with error '%s'",
|
||||||
|
@ -104,7 +104,7 @@ static int delete_node(char *name)
|
||||||
filename, strerror(errno));
|
filename, strerror(errno));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
dbg("removed %s", filename);
|
dbg("removed '%s'", filename);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return retval;
|
return retval;
|
||||||
|
|
11
udev.c
11
udev.c
|
@ -105,7 +105,7 @@ static void get_dirs(void)
|
||||||
if (temp)
|
if (temp)
|
||||||
udev_permission = temp;
|
udev_permission = temp;
|
||||||
}
|
}
|
||||||
dbg("sysfs_path = %s", sysfs_path);
|
dbg("sysfs_path='%s'", sysfs_path);
|
||||||
|
|
||||||
strncpy(udev_db_filename, udev_config_dir, sizeof(udev_db_filename));
|
strncpy(udev_db_filename, udev_config_dir, sizeof(udev_db_filename));
|
||||||
strncat(udev_db_filename, udev_db, sizeof(udev_db_filename));
|
strncat(udev_db_filename, udev_db, sizeof(udev_db_filename));
|
||||||
|
@ -141,12 +141,12 @@ int main(int argc, char **argv, char **envp)
|
||||||
dbg ("no devpath?");
|
dbg ("no devpath?");
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
dbg("looking at %s", devpath);
|
dbg("looking at '%s'", devpath);
|
||||||
|
|
||||||
/* we only care about class devices and block stuff */
|
/* we only care about class devices and block stuff */
|
||||||
if (!strstr(devpath, "class") &&
|
if (!strstr(devpath, "class") &&
|
||||||
!strstr(devpath, "block")) {
|
!strstr(devpath, "block")) {
|
||||||
dbg("not block or class");
|
dbg("not a block or class device");
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -166,7 +166,7 @@ int main(int argc, char **argv, char **envp)
|
||||||
get_dirs();
|
get_dirs();
|
||||||
retval = udevdb_init(UDEVDB_DEFAULT);
|
retval = udevdb_init(UDEVDB_DEFAULT);
|
||||||
if (retval != 0) {
|
if (retval != 0) {
|
||||||
dbg("Unable to initialize database.");
|
dbg("unable to initialize database");
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -180,7 +180,7 @@ int main(int argc, char **argv, char **envp)
|
||||||
retval = udev_remove_device(devpath, subsystem);
|
retval = udev_remove_device(devpath, subsystem);
|
||||||
|
|
||||||
else {
|
else {
|
||||||
dbg("Unknown action: %s", action);
|
dbg("unknown action '%s'", action);
|
||||||
retval = -EINVAL;
|
retval = -EINVAL;
|
||||||
}
|
}
|
||||||
udevdb_exit();
|
udevdb_exit();
|
||||||
|
@ -188,4 +188,3 @@ int main(int argc, char **argv, char **envp)
|
||||||
exit:
|
exit:
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
1
udev.h
1
udev.h
|
@ -95,4 +95,3 @@ extern char udev_config_permission_filename[PATH_MAX+NAME_MAX];
|
||||||
extern char udev_config_filename[PATH_MAX+NAME_MAX];
|
extern char udev_config_filename[PATH_MAX+NAME_MAX];
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
14
udevdb.c
14
udevdb.c
|
@ -54,7 +54,7 @@ int udevdb_add_dev(const char *path, const struct udevice *dev)
|
||||||
strcpy(keystr, path);
|
strcpy(keystr, path);
|
||||||
key.dptr = keystr;
|
key.dptr = keystr;
|
||||||
key.dsize = strlen(keystr) + 1;
|
key.dsize = strlen(keystr) + 1;
|
||||||
|
|
||||||
data.dptr = (void *)dev;
|
data.dptr = (void *)dev;
|
||||||
data.dsize = sizeof(*dev);
|
data.dsize = sizeof(*dev);
|
||||||
|
|
||||||
|
@ -79,7 +79,7 @@ struct udevice *udevdb_get_dev(const char *path)
|
||||||
dev = malloc(sizeof(*dev));
|
dev = malloc(sizeof(*dev));
|
||||||
if (dev == NULL)
|
if (dev == NULL)
|
||||||
goto exit;
|
goto exit;
|
||||||
|
|
||||||
memcpy(dev, data.dptr, sizeof(*dev));
|
memcpy(dev, data.dptr, sizeof(*dev));
|
||||||
exit:
|
exit:
|
||||||
free(data.dptr);
|
free(data.dptr);
|
||||||
|
@ -99,7 +99,7 @@ int udevdb_delete_dev(const char *path)
|
||||||
|
|
||||||
key.dptr = keystr;
|
key.dptr = keystr;
|
||||||
key.dsize = strlen(keystr) + 1;
|
key.dsize = strlen(keystr) + 1;
|
||||||
|
|
||||||
return tdb_delete(udevdb, key);
|
return tdb_delete(udevdb, key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -116,8 +116,8 @@ void udevdb_exit(void)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* udevdb_init: initializes database
|
* udevdb_init: initializes database
|
||||||
* @init_flag: database can either be in memory - UDEVDB_INTERNAL - or
|
* @init_flag: UDEVDB_INTERNAL - database stays in memory
|
||||||
* written to a file with UDEVDB_DEFAULT.
|
* UDEVDB_DEFAULT - database is written to a file
|
||||||
*/
|
*/
|
||||||
int udevdb_init(int init_flag)
|
int udevdb_init(int init_flag)
|
||||||
{
|
{
|
||||||
|
@ -127,9 +127,9 @@ int udevdb_init(int init_flag)
|
||||||
udevdb = tdb_open(udev_db_filename, 0, init_flag, O_RDWR | O_CREAT, 0644);
|
udevdb = tdb_open(udev_db_filename, 0, init_flag, O_RDWR | O_CREAT, 0644);
|
||||||
if (udevdb == NULL) {
|
if (udevdb == NULL) {
|
||||||
if (init_flag == UDEVDB_INTERNAL)
|
if (init_flag == UDEVDB_INTERNAL)
|
||||||
dbg("Unable to initialize in-memory database");
|
dbg("unable to initialize in-memory database");
|
||||||
else
|
else
|
||||||
dbg("Unable to initialize database at %s", udev_db_filename);
|
dbg("unable to initialize database at '%s'", udev_db_filename);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|
6
udevdb.h
6
udevdb.h
|
@ -5,10 +5,10 @@
|
||||||
#define _UDEVDB_H_
|
#define _UDEVDB_H_
|
||||||
|
|
||||||
/* Udevdb initialization flags */
|
/* Udevdb initialization flags */
|
||||||
#define UDEVDB_DEFAULT 0 /* Defaults database to use file */
|
#define UDEVDB_DEFAULT 0 /* defaults database to use file */
|
||||||
#define UDEVDB_INTERNAL 1 /* Don't store db on disk, use in memory */
|
#define UDEVDB_INTERNAL 1 /* don't store db on disk, use in memory */
|
||||||
|
|
||||||
/* Function Prototypes */
|
/* function prototypes */
|
||||||
extern void udevdb_exit(void);
|
extern void udevdb_exit(void);
|
||||||
extern int udevdb_init(int init_flag);
|
extern int udevdb_init(int init_flag);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue