]> www.infradead.org Git - users/sagi/libnvme.git/commitdiff
examples/telemetry: Fix scanning uevent file
authorKeith Busch <kbusch@kernel.org>
Thu, 6 Feb 2020 22:58:10 +0000 (14:58 -0800)
committerKeith Busch <kbusch@kernel.org>
Thu, 6 Feb 2020 22:58:10 +0000 (14:58 -0800)
Continue to the next line if current one does not contain async event
information.

Signed-off-by: Keith Busch <kbusch@kernel.org>
examples/telemetry-listen.c

index 1705462a6cc9954bf75d60329265797367cccc89..1561a0c740d40440a90600dbde307ad5ef269bbc 100644 (file)
@@ -11,7 +11,7 @@
 #include <unistd.h>
 #include <time.h>
 #include <libnvme.h>
-   
+
 struct events {
        nvme_ctrl_t c;
        int uevent_fd;
@@ -63,7 +63,6 @@ static void save_telemetry(nvme_ctrl_t c)
        else
                printf("telemetry log save as %s, wrote:%d size:%d\n", buf,
                        ret, log_size);
-
        close(fd);
        free(log);
 }
@@ -81,7 +80,7 @@ static void check_telemetry(nvme_ctrl_t c, int ufd)
                __u32 aen, type, info, lid;
 
                if (sscanf(p, "NVME_AEN=0x%08x", &aen) != 1)
-                       break;
+                       continue;
 
                type = aen & 0x07;
                info = (aen >> 8) & 0xff;