Commit 04a9d3a0 authored by Kay Sievers's avatar Kay Sievers

udev: fix gcc warnings showing up after adding $(AM_CFLAGS)

parent 235450b0
......@@ -119,3 +119,5 @@ libtool
/udevadm
/udevd
/v4l_id
/test-libudev
/test-udev
......@@ -84,6 +84,7 @@ INSTALL_DATA_HOOKS =
DISTCHECK_HOOKS =
DISTCLEAN_LOCAL_HOOKS =
pkginclude_HEADERS =
noinst_LTLIBRARIES =
lib_LTLIBRARIES =
include_HEADERS =
pkgconfiglib_DATA =
......@@ -549,12 +550,8 @@ EXTRA_DIST += \
$(MANPAGES_ALIAS)
# ------------------------------------------------------------------------------
noinst_LTLIBRARIES = \
libsystemd-basic.la \
libsystemd-capability.la \
libsystemd-audit.la \
libsystemd-acl.la \
libsystemd-core.la
noinst_LTLIBRARIES += \
libsystemd-basic.la
libsystemd_basic_la_SOURCES = \
src/shared/util.c \
......@@ -591,6 +588,9 @@ libsystemd_basic_la_LIBADD = \
$(SELINUX_LIBS)
# ------------------------------------------------------------------------------
noinst_LTLIBRARIES += \
libsystemd-capability.la
libsystemd_capability_la_SOURCES = \
src/shared/capability.c \
src/shared/capability.h
......@@ -603,6 +603,9 @@ libsystemd_capability_la_LIBADD = \
$(CAP_LIBS)
# ------------------------------------------------------------------------------
noinst_LTLIBRARIES += \
libsystemd-audit.la
libsystemd_audit_la_SOURCES = \
src/shared/audit.c \
src/shared/audit.h
......@@ -611,6 +614,9 @@ libsystemd_audit_la_LIBADD = \
libsystemd-capability.la
# ------------------------------------------------------------------------------
noinst_LTLIBRARIES += \
libsystemd-acl.la
libsystemd_acl_la_SOURCES = \
src/shared/acl.c \
src/shared/acl.h
......@@ -623,6 +629,9 @@ libsystemd_acl_la_LIBADD = \
$(ACL_LIBS)
# ------------------------------------------------------------------------------
noinst_LTLIBRARIES += \
libsystemd-core.la
libsystemd_core_la_SOURCES = \
src/unit.c \
src/unit.h \
......@@ -1208,9 +1217,6 @@ include_HEADERS += \
lib_LTLIBRARIES += \
libudev.la
noinst_LTLIBRARIES += \
libudev-private.la
libudev_la_SOURCES =\
src/udev/libudev-private.h \
src/udev/libudev.c \
......@@ -1221,24 +1227,14 @@ libudev_la_SOURCES =\
src/udev/libudev-monitor.c \
src/udev/libudev-queue.c
libudev_la_CFLAGS = \
$(AM_CFLAGS) \
-fvisibility=hidden
libudev_la_LDFLAGS = \
$(AM_LDFLAGS) \
-version-info $(LIBUDEV_CURRENT):$(LIBUDEV_REVISION):$(LIBUDEV_AGE)
libudev_private_la_SOURCES =\
$(libudev_la_SOURCES) \
src/udev/libudev-util-private.c \
src/udev/libudev-device-private.c \
src/udev/libudev-queue-private.c
if HAVE_SELINUX
libudev_private_la_SOURCES +=\
src/udev/libudev-selinux-private.c
endif
libudev_private_la_LIBADD = \
$(SELINUX_LIBS)
pkgconfiglib_DATA += \
src/udev/libudev.pc
......@@ -1264,6 +1260,28 @@ libudev-uninstall-move-hook:
INSTALL_EXEC_HOOKS += libudev-install-move-hook
UNINSTALL_EXEC_HOOKS += libudev-uninstall-move-hook
# ------------------------------------------------------------------------------
noinst_LTLIBRARIES += \
libudev-private.la
libudev_private_la_SOURCES =\
$(libudev_la_SOURCES) \
src/udev/libudev-util-private.c \
src/udev/libudev-device-private.c \
src/udev/libudev-queue-private.c
libudev_private_la_CFLAGS = \
$(AM_CFLAGS) \
-fvisibility=default
if HAVE_SELINUX
libudev_private_la_SOURCES +=\
src/udev/libudev-selinux-private.c
libudev_private_la_LIBADD = \
$(SELINUX_LIBS)
endif
# ------------------------------------------------------------------------------
udev-confdirs:
-mkdir -p $(DESTDIR)$(sysconfdir)/udev/rules.d
......@@ -1328,7 +1346,10 @@ bin_PROGRAMS += \
udevlibexec_PROGRAMS = \
udevd
udev_common_sources = \
noinst_LTLIBRARIES += \
libudev-core.la
libudev_core_la_SOURCES = \
src/udev/udev.h \
src/udev/udev-event.c \
src/udev/udev-watch.c \
......@@ -1342,51 +1363,43 @@ udev_common_sources = \
src/udev/udev-builtin-input_id.c \
src/udev/udev-builtin-kmod.c \
src/udev/udev-builtin-path_id.c \
src/udev/udev-builtin-usb_id.c \
src/systemd/sd-daemon.h \
src/sd-daemon.c
src/udev/udev-builtin-usb_id.c
udev_common_CFLAGS = \
libudev_core_la_CFLAGS = \
$(AM_CFLAGS) \
$(BLKID_CFLAGS) \
$(KMOD_CFLAGS)
udev_common_LDADD = \
libudev_core_la_LIBADD = \
libudev-private.la \
libsystemd-daemon.la \
$(BLKID_LIBS) \
$(KMOD_LIBS)
udev_common_CPPFLAGS = \
libudev_core_la_CPPFLAGS = \
$(AM_CPPFLAGS) \
-DFIRMWARE_PATH="$(FIRMWARE_PATH)" \
-DUSB_DATABASE=\"$(USB_DATABASE)\" -DPCI_DATABASE=\"$(PCI_DATABASE)\"
if HAVE_ACL
udev_common_sources += \
libudev_core_la_SOURCES += \
src/udev/udev-builtin-uaccess.c \
src/login/logind-acl.c
udev_common_LDADD += \
libudev_core_la_LIBADD += \
libsystemd-login.la \
libsystemd-acl.la
endif
udevd_SOURCES = \
$(udev_common_sources) \
src/udev/udevd.c
udevd_CFLAGS = \
$(udev_common_CFLAGS)
udevd_LDADD = \
$(udev_common_LDADD) \
libsystemd-basic.la
udevd_CPPFLAGS = \
$(udev_common_CPPFLAGS)
libudev-core.la \
libsystemd-basic.la \
libsystemd-daemon.la
udevadm_SOURCES = \
$(udev_common_sources) \
src/udev/udevadm.c \
src/udev/udevadm-info.c \
src/udev/udevadm-control.c \
......@@ -1396,15 +1409,11 @@ udevadm_SOURCES = \
src/udev/udevadm-test.c \
src/udev/udevadm-test-builtin.c
udevadm_CFLAGS = \
$(udev_common_CFLAGS)
udevadm_LDADD = \
$(udev_common_LDADD) \
libsystemd-basic.la
udevadm_CPPFLAGS = \
$(udev_common_CPPFLAGS)
libudev-core.la \
libudev-private.la \
libsystemd-basic.la \
libsystemd-daemon.la
# ------------------------------------------------------------------------------
TESTS = \
......@@ -1422,19 +1431,13 @@ test_libudev_LDADD = \
libudev.la
test_udev_SOURCES = \
$(udev_common_sources) \
src/udev/test-udev.c
test_udev_CFLAGS = \
$(udev_common_CFLAGS)
test_udev_LDADD = \
$(udev_common_LDADD) \
libudev-core.la \
libudev-private.la \
libsystemd-basic.la
test_udev_CPPFLAGS = \
$(udev_common_CPPFLAGS)
test_udev_DEPENDENCIES = \
src/udev/test/sys
......@@ -1467,7 +1470,7 @@ cdrom_id_SOURCES = \
src/udev/cdrom_id/cdrom_id.c
cdrom_id_LDADD = \
libudev-private.la \
libudev.la \
libsystemd-basic.la
udevlibexec_PROGRAMS += \
......@@ -1508,7 +1511,7 @@ v4l_id_SOURCES = \
src/udev/v4l_id/v4l_id.c
v4l_id_LDADD = \
libudev-private.la
libudev.la
udevlibexec_PROGRAMS += \
v4l_id
......@@ -1521,7 +1524,7 @@ accelerometer_SOURCES = \
src/udev/accelerometer/accelerometer.c
accelerometer_LDADD = \
libudev-private.la -lm \
libudev.la -lm \
libsystemd-basic.la
udevlibexec_PROGRAMS += \
......
......@@ -115,7 +115,6 @@ static int probe_superblocks(blkid_probe pr)
static int builtin_blkid(struct udev_device *dev, int argc, char *argv[], bool test)
{
struct udev *udev = udev_device_get_udev(dev);
int64_t offset = 0;
bool noraid = false;
int fd = -1;
......
......@@ -38,6 +38,8 @@
#define LONG(x) ((x)/BITS_PER_LONG)
#define test_bit(bit, array) ((array[LONG(bit)] >> OFF(bit)) & 1)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wformat-nonliteral"
/*
* Read a capability attribute and return bitmask.
* @param dev udev_device
......@@ -49,7 +51,6 @@ static void get_cap_mask(struct udev_device *dev,
unsigned long *bitmask, size_t bitmask_size,
bool test)
{
struct udev *udev = udev_device_get_udev(dev);
char text[4096];
unsigned i;
char* word;
......@@ -87,6 +88,7 @@ static void get_cap_mask(struct udev_device *dev,
log_debug(text, i * BITS_PER_LONG, bitmask[i]);
}
}
#pragma GCC diagnostic pop
/* pointer devices */
static void test_pointers (struct udev_device *dev,
......@@ -143,7 +145,6 @@ static void test_key (struct udev_device *dev,
const unsigned long* bitmask_key,
bool test)
{
struct udev *udev = udev_device_get_udev(dev);
unsigned i;
unsigned long found;
unsigned long mask;
......
......@@ -33,7 +33,7 @@
static void set_usb_iftype(char *to, int if_class_num, size_t len)
{
char *type = "generic";
const char *type = "generic";
switch (if_class_num) {
case 1:
......@@ -86,7 +86,7 @@ static int set_usb_mass_storage_ifsubtype(char *to, const char *from, size_t len
{
int type_num = 0;
char *eptr;
char *type = "generic";
const char *type = "generic";
type_num = strtoul(from, &eptr, 0);
if (eptr != from) {
......@@ -119,7 +119,7 @@ static void set_scsi_type(char *to, const char *from, size_t len)
{
int type_num;
char *eptr;
char *type = "generic";
const char *type = "generic";
type_num = strtoul(from, &eptr, 0);
if (eptr != from) {
......@@ -256,7 +256,6 @@ static int builtin_usb_id(struct udev_device *dev, int argc, char *argv[], bool
const char *driver = NULL;
char serial[256];
struct udev *udev = udev_device_get_udev(dev);
struct udev_device *dev_interface = NULL;
struct udev_device *dev_usb = NULL;
const char *if_class, *if_subclass;
......
......@@ -337,7 +337,6 @@ int udev_ctrl_send_exit(struct udev_ctrl *uctrl, int timeout)
struct udev_ctrl_msg *udev_ctrl_receive_msg(struct udev_ctrl_connection *conn)
{
struct udev *udev = conn->uctrl->udev;
struct udev_ctrl_msg *uctrl_msg;
ssize_t size;
struct msghdr smsg;
......
......@@ -86,8 +86,8 @@ size_t udev_event_apply_format(struct udev_event *event, const char *src, char *
SUBST_SYS,
};
static const struct subst_map {
char *name;
char fmt;
const char *name;
const char fmt;
enum subst_type type;
} map[] = {
{ .name = "devnode", .fmt = 'N', .type = SUBST_DEVNODE },
......@@ -386,7 +386,6 @@ static int spawn_exec(struct udev_event *event,
const char *cmd, char *const argv[], char **envp, const sigset_t *sigmask,
int fd_stdout, int fd_stderr)
{
struct udev *udev = event->udev;
int err;
int fd;
......@@ -433,7 +432,6 @@ static void spawn_read(struct udev_event *event,
int fd_stdout, int fd_stderr,
char *result, size_t ressize)
{
struct udev *udev = event->udev;
size_t respos = 0;
int fd_ep = -1;
struct epoll_event ep_outpipe, ep_errpipe;
......@@ -553,7 +551,6 @@ out:
static int spawn_wait(struct udev_event *event, const char *cmd, pid_t pid)
{
struct udev *udev = event->udev;
struct pollfd pfd[1];
int err = 0;
......@@ -939,7 +936,6 @@ int udev_event_execute_rules(struct udev_event *event, struct udev_rules *rules,
udev_device_unref(event->dev_db);
event->dev_db = NULL;
}
out:
return err;
}
......
......@@ -240,7 +240,6 @@ static void link_update(struct udev_device *dev, const char *slink, bool add)
void udev_node_update_old_links(struct udev_device *dev, struct udev_device *dev_old)
{
struct udev *udev = udev_device_get_udev(dev);
struct udev_list_entry *list_entry;
/* update possible left-over symlinks */
......@@ -322,7 +321,6 @@ void udev_node_add(struct udev_device *dev, mode_t mode, uid_t uid, gid_t gid)
struct udev *udev = udev_device_get_udev(dev);
char filename[UTIL_PATH_SIZE];
struct udev_list_entry *list_entry;
int err = 0;
log_debug("handling device node '%s', devnum=%s, mode=%#o, uid=%d, gid=%d\n",
udev_device_get_devnode(dev), udev_device_get_id_filename(dev), mode, uid, gid);
......@@ -351,9 +349,6 @@ void udev_node_remove(struct udev_device *dev)
{
struct udev *udev = udev_device_get_udev(dev);
struct udev_list_entry *list_entry;
const char *devnode;
struct stat stats;
struct udev_device *dev_check;
char filename[UTIL_PATH_SIZE];
/* remove/update symlinks, remove symlinks from name index */
......
......@@ -781,7 +781,6 @@ static int import_program_into_properties(struct udev_event *event, const char *
static int import_parent_into_properties(struct udev_device *dev, const char *filter)
{
struct udev *udev = udev_device_get_udev(dev);
struct udev_device *dev_parent;
struct udev_list_entry *list_entry;
......@@ -969,7 +968,7 @@ static int get_key(struct udev *udev, char **line, char **key, enum operation_ty
}
/* extract possible KEY{attr} */
static char *get_key_attribute(struct udev *udev, char *str)
static const char *get_key_attribute(struct udev *udev, char *str)
{
char *pos;
char *attr;
......@@ -1178,7 +1177,7 @@ static int add_rule(struct udev_rules *rules, char *line,
const char *filename, unsigned int filename_off, unsigned int lineno)
{
char *linepos;
char *attr;
const char *attr;
struct rule_tmp rule_tmp;
memset(&rule_tmp, 0x00, sizeof(struct rule_tmp));
......
......@@ -52,7 +52,6 @@ static bool skip_attribute(const char *name)
static void print_all_attributes(struct udev_device *device, const char *key)
{
struct udev *udev = udev_device_get_udev(device);
struct udev_list_entry *sysattr;
udev_list_entry_foreach(sysattr, udev_device_get_sysattr_list_entry(device)) {
......
......@@ -38,7 +38,6 @@ static int dry_run;
static void exec_list(struct udev_enumerate *udev_enumerate, const char *action)
{
struct udev *udev = udev_enumerate_get_udev(udev_enumerate);
struct udev_list_entry *entry;
udev_list_entry_foreach(entry, udev_enumerate_get_list_entry(udev_enumerate)) {
......
......@@ -880,11 +880,6 @@ static void static_dev_create_from_modules(struct udev *udev)
static void static_dev_create_links(struct udev *udev)
{
DIR *dir;
dir = opendir(udev_get_dev_path(udev));
if (dir == NULL)
return;
struct stdlinks {
const char *link;
const char *target;
......@@ -898,6 +893,10 @@ static void static_dev_create_links(struct udev *udev)
};
unsigned int i;
dir = opendir(udev_get_dev_path(udev));
if (dir == NULL)
return;
for (i = 0; i < ARRAY_SIZE(stdlinks); i++) {
struct stat sb;
......@@ -1115,7 +1114,6 @@ int main(int argc, char *argv[])
int fd_worker = -1;
struct epoll_event ep_ctrl, ep_inotify, ep_signal, ep_netlink, ep_worker;
struct udev_ctrl_connection *ctrl_conn = NULL;
char **s;
int rc = 1;
udev = udev_new();
......@@ -1525,7 +1523,7 @@ int main(int argc, char *argv[])
continue;
if ((now_usec() - worker->event_start_usec) > 30 * 1000 * 1000) {
log_error("worker [%u] timeout, kill it\n", worker->pid,
log_error("worker [%u] %s timeout; kill it\n", worker->pid,
worker->event ? worker->event->devpath : "<idle>");
kill(worker->pid, SIGKILL);
worker->state = WORKER_KILLED;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment