]> err.no Git - systemd/commitdiff
fix more warnings
authorKay Sievers <kay.sievers@vrfy.org>
Thu, 14 Apr 2011 22:19:45 +0000 (00:19 +0200)
committerKay Sievers <kay.sievers@vrfy.org>
Thu, 14 Apr 2011 22:19:45 +0000 (00:19 +0200)
NEWS
extras/keymap/keymap.c
extras/path_id/path_id.c
extras/scsi_id/scsi_id.c
extras/scsi_id/scsi_serial.c
extras/udev-acl/udev-acl.c

diff --git a/NEWS b/NEWS
index 6647fd4c248a6e427db2fb3b1a335727f405500b..ccbaa46cd94cfd3356973229f5d7f31120b8c033 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -8,6 +8,9 @@ udevadm control --exit
 
 udevadm info --cleanup-db
 
+systemd netlink socket activation
+requires systemd 25
+
 udev 167
 ========
 Bugfixes.
index eabd1e44d823f768703cc74de0bb2a363b3c3280..597a53b467c20094b0233fb4d234f2ec38d438d2 100644 (file)
@@ -192,8 +192,7 @@ static int merge_table(int fd, const char *filename) {
        f = fopen(filename, "r");
        if (!f) {
                perror(filename);
-               r = -1;
-               goto fail;
+               return -1;
        }
 
        while (!feof(f)) {
@@ -243,6 +242,7 @@ static int merge_table(int fd, const char *filename) {
                                scancode, new_keycode, old_keycode);
        }
 fail:
+       fclose(f);
        return r;
 }
 
index db13eeba273fd0d54d590bd7c069ea65aff46988..518ec8b386a782596404a1cd3aede55a60cb9593 100644 (file)
@@ -137,15 +137,13 @@ static struct udev_device *handle_scsi_iscsi(struct udev_device *parent, char **
 
        /* find iscsi session */
        transportdev = parent;
-       while (1) {
+       for (;;) {
                transportdev = udev_device_get_parent(transportdev);
                if (transportdev == NULL)
                        return NULL;
                if (strncmp(udev_device_get_sysname(transportdev), "session", 7) == 0)
                        break;
        }
-       if (transportdev == NULL)
-               return NULL;
 
        /* find iscsi session device */
        sessiondev = udev_device_new_from_subsystem_sysname(udev, "iscsi_session", udev_device_get_sysname(transportdev));
index 6c8826568f38de953122c7bbb065997c30dc5439..c14d411841ab6d85e3431721565817fb078aaa8c 100644 (file)
@@ -199,6 +199,7 @@ static int get_file_options(struct udev *udev,
         */
        buffer = malloc(MAX_BUFFER_LEN);
        if (!buffer) {
+               fclose(fd);
                err(udev, "can't allocate memory\n");
                return -1;
        }
index 516a6f16c5c791cd0b6dc00c3ee914af5ac55831..5cde9a54a06a0633c654da89ac2973aab214c32e 100644 (file)
@@ -141,13 +141,13 @@ static int sg_err_category_new(struct udev *udev,
                }
                return SG_ERR_CAT_SENSE;
        }
-       if (!host_status) {
+       if (host_status) {
                if ((host_status == DID_NO_CONNECT) ||
                    (host_status == DID_BUS_BUSY) ||
                    (host_status == DID_TIME_OUT))
                        return SG_ERR_CAT_TIMEOUT;
        }
-       if (!driver_status) {
+       if (driver_status) {
                if (driver_status == DRIVER_TIMEOUT)
                        return SG_ERR_CAT_TIMEOUT;
        }
@@ -322,8 +322,10 @@ static int scsi_inquiry(struct udev *udev,
                { INQUIRY_CMD, evpd, page, 0, buflen, 0 };
        unsigned char sense[SENSE_BUFF_LEN];
        void *io_buf;
-       int retval;
+       struct sg_io_v4 io_v4;
+       struct sg_io_hdr io_hdr;
        int retry = 3; /* rather random */
+       int retval;
 
        if (buflen > SCSI_INQ_BUFF_LEN) {
                info(udev, "buflen %d too long\n", buflen);
@@ -334,8 +336,6 @@ resend:
        dbg(udev, "%s evpd %d, page 0x%x\n", dev_scsi->kernel, evpd, page);
 
        if (dev_scsi->use_sg == 4) {
-               struct sg_io_v4 io_v4;
-
                memset(&io_v4, 0, sizeof(struct sg_io_v4));
                io_v4.guard = 'Q';
                io_v4.protocol = BSG_PROTOCOL_SCSI;
@@ -348,8 +348,6 @@ resend:
                io_v4.din_xferp = (uintptr_t)buf;
                io_buf = (void *)&io_v4;
        } else {
-               struct sg_io_hdr io_hdr;
-
                memset(&io_hdr, 0, sizeof(struct sg_io_hdr));
                io_hdr.interface_id = 'S';
                io_hdr.cmd_len = sizeof(inq_cmd);
index 2dd3e6cac9bcfd08be8599387c62d74503b07ca6..35bad76034972e23ff0e6295891b7b2e5518cdc4 100644 (file)
@@ -258,11 +258,6 @@ static int consolekit_called(const char *ck_action, uid_t *uid, uid_t *uid2, con
                        u = u2;
                }
                break;
-       case ACTION_NONE:
-               break;
-       default:
-               g_assert_not_reached();
-               break;
        }
 
        *remove_session_id = old_session;