From be2de973ce3a9ca93a8ff89b47133115c4506adb Mon Sep 17 00:00:00 2001 From: Neale Pickett Date: Tue, 7 Sep 2010 22:43:24 -0600 Subject: [PATCH] pointscli check result of write --- src/common.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/common.c b/src/common.c index 6b03cf1..dea8a60 100644 --- a/src/common.c +++ b/src/common.c @@ -92,7 +92,11 @@ award_points(char *teamhash, char *category, int points) return -1; } - write(fd, line, linelen); + if (-1 == write(fd, line, linelen)) { + close(fd); + return -1; + } + close(fd); return 0; }