mirror of
https://github.com/systemd/systemd-stable.git
synced 2024-11-01 00:51:08 +03:00
libudev: device_init() -> device_new()
This commit is contained in:
parent
d98bffa802
commit
e0083e8e69
@ -193,7 +193,7 @@ void device_set_info_loaded(struct udev_device *device)
|
|||||||
device->info_loaded = 1;
|
device->info_loaded = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct udev_device *device_init(struct udev *udev)
|
struct udev_device *device_new(struct udev *udev)
|
||||||
{
|
{
|
||||||
struct udev_device *udev_device;
|
struct udev_device *udev_device;
|
||||||
|
|
||||||
@ -281,7 +281,7 @@ struct udev_device *udev_device_new_from_syspath(struct udev *udev, const char *
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
udev_device = device_init(udev);
|
udev_device = device_new(udev);
|
||||||
if (udev_device == NULL)
|
if (udev_device == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
@ -284,7 +284,7 @@ struct udev_device *udev_monitor_receive_device(struct udev_monitor *udev_monito
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
udev_device = device_init(udev_monitor->udev);
|
udev_device = device_new(udev_monitor->udev);
|
||||||
if (udev_device == NULL) {
|
if (udev_device == NULL) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -24,27 +24,20 @@
|
|||||||
#include "libudev.h"
|
#include "libudev.h"
|
||||||
|
|
||||||
static inline void __attribute__ ((format(printf, 2, 3)))
|
static inline void __attribute__ ((format(printf, 2, 3)))
|
||||||
log_null(struct udev *udev, const char *format, ...)
|
log_null(struct udev *udev, const char *format, ...) {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef USE_LOG
|
#ifdef USE_LOG
|
||||||
#ifdef USE_DEBUG
|
# ifdef USE_DEBUG
|
||||||
#define dbg(udev, arg...) \
|
# define dbg(udev, arg...) udev_log(udev, LOG_DEBUG, __FILE__, __LINE__, __FUNCTION__, ## arg)
|
||||||
udev_log(udev, LOG_DEBUG, __FILE__, __LINE__, __FUNCTION__, ## arg)
|
# else
|
||||||
|
# define dbg log_null
|
||||||
|
# endif
|
||||||
|
# define info(udev, arg...) udev_log(udev, LOG_INFO, __FILE__, __LINE__, __FUNCTION__, ## arg)
|
||||||
|
# define err(udev, arg...) udev_log(udev, LOG_ERR, __FILE__, __LINE__, __FUNCTION__, ## arg)
|
||||||
#else
|
#else
|
||||||
#define dbg log_null
|
# define dbg log_null
|
||||||
#endif /* USE_DEBUG */
|
# define info log_null
|
||||||
|
# define err log_null
|
||||||
#define info(udev, arg...) \
|
|
||||||
udev_log(udev, LOG_INFO, __FILE__, __LINE__, __FUNCTION__, ## arg)
|
|
||||||
|
|
||||||
#define err(udev, arg...) \
|
|
||||||
udev_log(udev, LOG_ERR, __FILE__, __LINE__, __FUNCTION__, ## arg)
|
|
||||||
#else
|
|
||||||
#define dbg log_null
|
|
||||||
#define info log_null
|
|
||||||
#define err log_null
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* libudev */
|
/* libudev */
|
||||||
@ -52,7 +45,7 @@ void udev_log(struct udev *udev,
|
|||||||
int priority, const char *file, int line, const char *fn,
|
int priority, const char *file, int line, const char *fn,
|
||||||
const char *format, ...)
|
const char *format, ...)
|
||||||
__attribute__ ((format(printf, 6, 7)));
|
__attribute__ ((format(printf, 6, 7)));
|
||||||
extern struct udev_device *device_init(struct udev *udev);
|
extern struct udev_device *device_new(struct udev *udev);
|
||||||
extern const char *udev_get_rules_path(struct udev *udev);
|
extern const char *udev_get_rules_path(struct udev *udev);
|
||||||
extern int udev_get_run(struct udev *udev);
|
extern int udev_get_run(struct udev *udev);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user