Diff between 605e078556d0a23b60e9a65b5db20334a544e738 and d36983e032e98545c3d90154b1d94605c73170c2
Changed Files
| File | Additions | Deletions | Status |
| src/gatt-database.c | +5 | -0 | modified |
Full Patch
diff --git a/src/gatt-database.c b/src/gatt-database.c
index 5756eb9..8472aac 100644
--- a/src/gatt-database.c
+++ b/src/gatt-database.c
@@ -2598,6 +2598,11 @@ static bool sock_io_read(struct io *io, void *user_data)
int fd = io_get_fd(io);
ssize_t bytes_read;
+ if (fd < 0) {
+ error("io_get_fd() returned %d\n", fd);
+ return false;
+ }
+
bytes_read = read(fd, buf, sizeof(buf));
if (bytes_read <= 0)
return false;