commit 82866a247d82738273f915a45590e5ab0077fe19
parent 7d189b006c8df307a83cbe76407a79f8a8a03dde
Author: Colin Leroy <colin@colino.net>
Date: Fri, 20 Jun 2014 14:10:35 +0200
Fix unchecked return values. Patch by Christian Hesse
Diffstat:
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/plugins/archive/archiver_gtk.c b/src/plugins/archive/archiver_gtk.c
@@ -301,7 +301,8 @@ static void create_md5sum(const gchar* file, const gchar* md5_file) {
text = g_strdup_printf("%s %s\n", md5sum, file);
g_free(md5sum);
debug_print("md5sum: %s\n", text);
- write(fd, text, strlen(text));
+ if (write(fd, text, strlen(text)) < 0)
+ perror("write");
close(fd);
g_free(text);
}
diff --git a/src/plugins/mailmbox/maillock.c b/src/plugins/mailmbox/maillock.c
@@ -184,7 +184,8 @@ static int lock_common(const char * filename, int fd, short locktype)
fd = open(lockfilename, O_WRONLY|O_EXCL|O_CREAT, 0);
if (fd >= 0) {
/* defeat lock checking programs which test pid */
- write(fd, "0", 2);
+ if (write(fd, "0", 2) < 0)
+ perror("write");
close(fd);
break;
}