pointscli check result of write

This commit is contained in:
Neale Pickett 2010-09-07 22:43:24 -06:00
parent 00dad4865b
commit be2de973ce
1 changed files with 5 additions and 1 deletions

View File

@ -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;
}