mirror of
https://github.com/systemd/systemd-stable.git
synced 2024-12-27 03:21:32 +03:00
[PATCH] rename udevdb* to udev_db*
This commit is contained in:
parent
8673dcb842
commit
02fa9ae589
6
Makefile
6
Makefile
@ -210,7 +210,7 @@ OBJS = udev_lib.o \
|
||||
udev_add.o \
|
||||
udev_remove.o \
|
||||
udev_sysfs.o \
|
||||
udevdb.o \
|
||||
udev_db.o \
|
||||
namedev.o \
|
||||
namedev_parse.o \
|
||||
dev_d.o \
|
||||
@ -220,7 +220,7 @@ HEADERS = udev.h \
|
||||
udev_lib.h \
|
||||
namedev.h \
|
||||
udev_version.h \
|
||||
udevdb.h \
|
||||
udev_db.h \
|
||||
udev_sysfs.h \
|
||||
logging.h \
|
||||
selinux.h \
|
||||
@ -292,7 +292,7 @@ $(TESTER): $(LIBC) $(TESTER).o $(OBJS) $(HEADERS)
|
||||
$(QUIET) $(STRIPCMD) $@
|
||||
|
||||
$(INFO): $(LIBC) $(INFO).o $(OBJS) $(HEADERS)
|
||||
$(QUIET) $(LD) $(LDFLAGS) -o $@ $(CRT0) udevinfo.o udev_lib.o udev_config.o udevdb.o $(SYSFS) $(LIB_OBJS) $(ARCH_LIB_OBJS)
|
||||
$(QUIET) $(LD) $(LDFLAGS) -o $@ $(CRT0) udevinfo.o udev_lib.o udev_config.o udev_db.o $(SYSFS) $(LIB_OBJS) $(ARCH_LIB_OBJS)
|
||||
$(QUIET) $(STRIPCMD) $@
|
||||
|
||||
$(DAEMON): $(LIBC) $(DAEMON).o $(OBJS) udevd.h
|
||||
|
1
dev_d.c
1
dev_d.c
@ -29,7 +29,6 @@
|
||||
|
||||
#include "udev.h"
|
||||
#include "udev_lib.h"
|
||||
#include "udevdb.h"
|
||||
#include "logging.h"
|
||||
|
||||
static int run_program(const char *filename, void *data)
|
||||
|
@ -40,7 +40,7 @@
|
||||
#include "udev_version.h"
|
||||
#include "logging.h"
|
||||
#include "namedev.h"
|
||||
#include "udevdb.h"
|
||||
#include "udev_db.h"
|
||||
|
||||
static struct sysfs_attribute *find_sysfs_attribute(struct sysfs_class_device *class_dev, struct sysfs_device *sysfs_device, char *attr);
|
||||
|
||||
@ -194,7 +194,7 @@ static int find_free_number(struct udevice *udev, const char *name)
|
||||
while (1) {
|
||||
dbg("look for existing node '%s'", filename);
|
||||
memset(&db_udev, 0x00, sizeof(struct udevice));
|
||||
if (udevdb_get_dev_byname(&db_udev, filename) != 0) {
|
||||
if (udev_db_get_device_byname(&db_udev, filename) != 0) {
|
||||
dbg("free num=%d", num);
|
||||
return num;
|
||||
}
|
||||
|
3
udev.c
3
udev.c
@ -34,9 +34,8 @@
|
||||
#include "udev_lib.h"
|
||||
#include "udev_sysfs.h"
|
||||
#include "udev_version.h"
|
||||
#include "logging.h"
|
||||
#include "namedev.h"
|
||||
#include "udevdb.h"
|
||||
#include "logging.h"
|
||||
|
||||
|
||||
#ifdef LOG
|
||||
|
@ -42,7 +42,7 @@
|
||||
#include "udev_version.h"
|
||||
#include "logging.h"
|
||||
#include "namedev.h"
|
||||
#include "udevdb.h"
|
||||
#include "udev_db.h"
|
||||
|
||||
#include "selinux.h"
|
||||
|
||||
@ -303,8 +303,8 @@ int udev_add_device(struct udevice *udev, struct sysfs_class_device *class_dev)
|
||||
if (retval != 0)
|
||||
goto exit;
|
||||
|
||||
if (udevdb_add_dev(udev) != 0)
|
||||
dbg("udevdb_add_dev failed, but we create the node anyway, "
|
||||
if (udev_db_add_device(udev) != 0)
|
||||
dbg("udev_db_add_dev failed, but we create the node anyway, "
|
||||
"remove might not work for custom names");
|
||||
|
||||
/* use full path to the environment */
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* udevdb.c
|
||||
* udev_db.c
|
||||
*
|
||||
* Userspace devfs
|
||||
*
|
||||
@ -35,7 +35,7 @@
|
||||
#include "udev.h"
|
||||
#include "udev_lib.h"
|
||||
#include "logging.h"
|
||||
#include "udevdb.h"
|
||||
#include "udev_db.h"
|
||||
|
||||
#define PATH_TO_NAME_CHAR '@'
|
||||
|
||||
@ -57,7 +57,7 @@ static int get_db_filename(struct udevice *udev, char *filename, int len)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int udevdb_add_dev(struct udevice *udev)
|
||||
int udev_db_add_device(struct udevice *udev)
|
||||
{
|
||||
char filename[SYSFS_PATH_MAX];
|
||||
FILE *f;
|
||||
@ -135,7 +135,7 @@ static int parse_db_file(struct udevice *udev, const char *filename)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int udevdb_get_dev(struct udevice *udev)
|
||||
int udev_db_get_device(struct udevice *udev)
|
||||
{
|
||||
char filename[SYSFS_PATH_MAX];
|
||||
|
||||
@ -144,7 +144,7 @@ int udevdb_get_dev(struct udevice *udev)
|
||||
return parse_db_file(udev, filename);
|
||||
}
|
||||
|
||||
int udevdb_delete_dev(struct udevice *udev)
|
||||
int udev_db_delete_device(struct udevice *udev)
|
||||
{
|
||||
char filename[SYSFS_PATH_MAX];
|
||||
|
||||
@ -154,7 +154,7 @@ int udevdb_delete_dev(struct udevice *udev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int udevdb_get_dev_byname(struct udevice *udev, const char *name)
|
||||
int udev_db_get_device_byname(struct udevice *udev, const char *name)
|
||||
{
|
||||
struct dirent *ent;
|
||||
DIR *dir;
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* udevdb.h
|
||||
* udev_db.h
|
||||
*
|
||||
* Userspace devfs
|
||||
*
|
||||
@ -21,14 +21,14 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _UDEVDB_H_
|
||||
#define _UDEVDB_H_
|
||||
#ifndef _UDEV_DB_H_
|
||||
#define _UDEV_DB_H_
|
||||
|
||||
|
||||
extern int udevdb_add_dev(struct udevice *dev);
|
||||
extern int udevdb_get_dev(struct udevice *dev);
|
||||
extern int udevdb_delete_dev(struct udevice *dev);
|
||||
extern int udev_db_add_device(struct udevice *dev);
|
||||
extern int udev_db_get_device(struct udevice *dev);
|
||||
extern int udev_db_delete_device(struct udevice *dev);
|
||||
|
||||
extern int udevdb_get_dev_byname(struct udevice *udev, const char *name);
|
||||
extern int udev_db_get_device_byname(struct udevice *udev, const char *name);
|
||||
|
||||
#endif /* _UDEVDB_H_ */
|
||||
#endif /* _UDEV_DB_H_ */
|
@ -33,9 +33,9 @@
|
||||
#include "udev.h"
|
||||
#include "udev_lib.h"
|
||||
#include "udev_version.h"
|
||||
#include "logging.h"
|
||||
#include "namedev.h"
|
||||
#include "udevdb.h"
|
||||
#include "udev_db.h"
|
||||
#include "logging.h"
|
||||
|
||||
static int delete_path(const char *path)
|
||||
{
|
||||
@ -175,7 +175,7 @@ int udev_remove_device(struct udevice *udev)
|
||||
if (udev->type != 'b' && udev->type != 'c')
|
||||
return 0;
|
||||
|
||||
retval = udevdb_get_dev(udev);
|
||||
retval = udev_db_get_device(udev);
|
||||
if (retval) {
|
||||
/* fall back to kernel name */
|
||||
temp = strrchr(udev->devpath, '/');
|
||||
@ -186,7 +186,7 @@ int udev_remove_device(struct udevice *udev)
|
||||
}
|
||||
|
||||
dbg("remove name='%s'", udev->name);
|
||||
udevdb_delete_dev(udev);
|
||||
udev_db_delete_device(udev);
|
||||
|
||||
/* use full path to the environment */
|
||||
snprintf(udev->devname, NAME_SIZE, "%s/%s", udev_root, udev->name);
|
||||
|
@ -32,8 +32,8 @@
|
||||
#include "udev.h"
|
||||
#include "udev_lib.h"
|
||||
#include "udev_version.h"
|
||||
#include "udev_db.h"
|
||||
#include "logging.h"
|
||||
#include "udevdb.h"
|
||||
|
||||
|
||||
#define SYSFS_VALUE_SIZE 256
|
||||
@ -355,7 +355,7 @@ static int process_options(int argc, char *argv[])
|
||||
}
|
||||
memset(&udev, 0x00, sizeof(struct udevice));
|
||||
strfieldcpy(udev.devpath, pos);
|
||||
retval = udevdb_get_dev(&udev);
|
||||
retval = udev_db_get_device(&udev);
|
||||
if (retval != 0) {
|
||||
printf("device not found in database\n");
|
||||
goto exit;
|
||||
@ -374,7 +374,7 @@ static int process_options(int argc, char *argv[])
|
||||
|
||||
memset(&udev, 0x00, sizeof(struct udevice));
|
||||
strfieldcpy(udev.name, pos);
|
||||
retval = udevdb_get_dev_byname(&udev, pos);
|
||||
retval = udev_db_get_device_byname(&udev, pos);
|
||||
if (retval != 0) {
|
||||
printf("device not found in database\n");
|
||||
goto exit;
|
||||
|
@ -31,8 +31,8 @@
|
||||
#include "udev.h"
|
||||
#include "udev_lib.h"
|
||||
#include "udev_version.h"
|
||||
#include "logging.h"
|
||||
#include "namedev.h"
|
||||
#include "logging.h"
|
||||
|
||||
|
||||
#ifdef LOG
|
||||
|
Loading…
Reference in New Issue
Block a user