Skip to contentSkip to conversation

coverity: Model g_poll()

PATCH Applied Markus Armbruster 2 participants 3 messages Dec 17, 2015

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 coverity: Model g_poll()

In my testing, Coverity reported two more CHECKED_RETURN:

* qemu-char.c:1248: fixed in commit c1f2448: "qemu-char: retry g_poll on EINTR".

* migration/qemu-file-unix.c:75: harmless, cleaned up in commit 4e39f57 "migration: Clean up use of g_poll() in socket_writev_buffer()

---
v2: Commit message body rewritten, because fixes have been committed meanwhile.

 scripts/coverity-model.c | 9 +++++++++
 1 file changed, 9 insertions(+)
scripts/coverity-model.c +9 -0
index e1d5f45..ee5bf9d 100644
@@ -342,6 +342,15 @@ char *g_strconcat(const char *s, ...)
 
 /* Other glib functions */
 
+typedef struct pollfd GPollFD;
+
+int poll();
+
+int g_poll (GPollFD *fds, unsigned nfds, int timeout)
+{
+    return poll(fds, nfds, timeout);
+}
+
 typedef struct _GIOChannel GIOChannel;
 GIOChannel *g_io_channel_unix_new(int fd)
 {
Signature · 1 line
2.4.3
#1 lore raw
Quoted 5 lines · Markus Armbruster

In my testing, Coverity reported two more CHECKED_RETURN:

* qemu-char.c:1248: fixed in commit c1f2448: "qemu-char: retry g_poll on EINTR".

Quoted 8 lines

* migration/qemu-file-unix.c:75: harmless, cleaned up in commit 4e39f57 "migration: Clean up use of g_poll() in socket_writev_buffer()

---
v2: Commit message body rewritten, because fixes have been committed meanwhile.

Applied, thanks!

Paolo

Quoted 24 lines
 scripts/coverity-model.c | 9 +++++++++
 1 file changed, 9 insertions(+)
scripts/coverity-model.c +9 -0
index e1d5f45..ee5bf9d 100644
@@ -342,6 +342,15 @@ char *g_strconcat(const char *s, ...)
 
 /* Other glib functions */
 
+typedef struct pollfd GPollFD;
+
+int poll();
+
+int g_poll (GPollFD *fds, unsigned nfds, int timeout)
+{
+    return poll(fds, nfds, timeout);
+}
+
 typedef struct _GIOChannel GIOChannel;
 GIOChannel *g_io_channel_unix_new(int fd)
 {
#2 lore raw
Quoted 10 lines · Paolo Bonzini
Quoted 9 lines · Markus Armbruster

In my testing, Coverity reported two more CHECKED_RETURN:

* qemu-char.c:1248: fixed in commit c1f2448: "qemu-char: retry g_poll on EINTR".

* migration/qemu-file-unix.c:75: harmless, cleaned up in commit 4e39f57 "migration: Clean up use of g_poll() in socket_writev_buffer()

Quoted 6 lines
Quoted 4 lines

---
v2: Commit message body rewritten, because fixes have been committed meanwhile.

Applied, thanks!

There's also

    Subject: [PATCH] coverity: Model g_memdup()
    Date: Mon, 30 Nov 2015 17:32:32 +0100
    Message-Id: <[email protected]>

I can post a pull request for both, but I'm of course happy to let them flow through your tree.