diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2009-08-25 21:45:27 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2009-08-25 21:45:27 +0000 |
commit | ddb86d0ee51641b7becb807d8bda3eaa9c0ec745 (patch) | |
tree | 8837813fbbd14af92cb2356feb431995059fc0db /sys | |
parent | 4d966d66840ff6234f2b88ff76fc25f1b9f8554a (diff) |
add error checking
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/microcode/udl/build.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/dev/microcode/udl/build.c b/sys/dev/microcode/udl/build.c index e9929f250fb..6e1855ccd31 100644 --- a/sys/dev/microcode/udl/build.c +++ b/sys/dev/microcode/udl/build.c @@ -1,4 +1,4 @@ -/* $OpenBSD: build.c,v 1.2 2009/08/25 21:43:24 deraadt Exp $ */ +/* $OpenBSD: build.c,v 1.3 2009/08/25 21:45:26 deraadt Exp $ */ /* * Copyright (c) 2009 Marcus Glocker <mglocker@openbsd.org> @@ -40,8 +40,10 @@ main(void) for (i = 0; i < UDL_HUFFMAN_RECORDS; i++) { size = udl_huffman[i].size; value = htobe32(udl_huffman[i].value); - write(fd, &size, sizeof(size)); - write(fd, &value, sizeof(value)); + if (write(fd, &size, sizeof(size)) == -1) + err(1, "write"); + if (write(fd, &value, sizeof(value)) == -1) + err(1, "write"); } close(fd); |