summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Ådahl <jadahl@gmail.com>2012-03-30 23:10:27 +0200
committerKristian Høgsberg <krh@bitplanet.net>2012-04-03 14:50:15 -0400
commit3685c3abf6c6f7d03b571458df52731ccf928981 (patch)
treeb9f62ef56a43248d267bc061b429fea62a233137
parent1103a1a484999dc0d53eb6a42bc62f461a0a582d (diff)
Fix `unused-result' warnings.
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
-rw-r--r--clients/dnd.c4
-rw-r--r--clients/window.c4
-rw-r--r--shared/image-loader.c6
3 files changed, 10 insertions, 4 deletions
diff --git a/clients/dnd.c b/clients/dnd.c
index e3d3c34b..8e67dc4d 100644
--- a/clients/dnd.c
+++ b/clients/dnd.c
@@ -272,7 +272,9 @@ data_source_send(void *data, struct wl_data_source *source,
dnd_flower_message.x_offset = dnd_drag->x_offset;
dnd_flower_message.y_offset = dnd_drag->y_offset;
- write(fd, &dnd_flower_message, sizeof dnd_flower_message);
+ if (write(fd, &dnd_flower_message, sizeof dnd_flower_message) < 0)
+ abort();
+
close(fd);
}
diff --git a/clients/window.c b/clients/window.c
index 73b7e888..9f5b837c 100644
--- a/clients/window.c
+++ b/clients/window.c
@@ -1984,7 +1984,9 @@ data_offer_receive_data(struct data_offer *offer, const char *mime_type,
{
int p[2];
- pipe2(p, O_CLOEXEC);
+ if (pipe2(p, O_CLOEXEC) == -1)
+ return;
+
wl_data_offer_receive(offer->offer, mime_type, p[1]);
close(p[1]);
diff --git a/shared/image-loader.c b/shared/image-loader.c
index 98cc431b..029b92e1 100644
--- a/shared/image-loader.c
+++ b/shared/image-loader.c
@@ -157,7 +157,7 @@ read_func(png_structp png, png_bytep data, png_size_t size)
{
FILE *fp = png_get_io_ptr(png);
- if (fread(data, 1, size, fp) < 0)
+ if (fread(data, 1, size, fp) != size)
png_error(png, NULL);
}
@@ -356,7 +356,9 @@ load_image(const char *filename)
if (fp == NULL)
return NULL;
- fread(header, sizeof header, 1, fp);
+ if (fread(header, sizeof header, 1, fp) != 1)
+ return NULL;
+
rewind(fp);
for (i = 0; i < ARRAY_LENGTH(loaders); i++) {
if (memcmp(header, loaders[i].header,