diff options
author | Roland Bär <roland@verifysoft.de> | 2007-09-24 13:47:26 -0700 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2007-09-24 13:47:26 -0700 |
commit | 919709af6ba19eb30d293a161d89a0b8fccb9ec7 (patch) | |
tree | 5a64450d051ce0b89a9aa351b98cbf1643f650e1 /src | |
parent | c8cb87d35686c155143ed3e511e1ea674d8371a3 (diff) |
[i965] Bug #11812: Fix fwrite return value checks in AUB file code.
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_aub.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_aub.c b/src/mesa/drivers/dri/i965/brw_aub.c index f851a5b79..c549f7a4f 100644 --- a/src/mesa/drivers/dri/i965/brw_aub.c +++ b/src/mesa/drivers/dri/i965/brw_aub.c @@ -80,7 +80,7 @@ static void init_aubfile( FILE *aub_file ) fh.hour = (nr>>16) & 0xff; fh.comment_length = 0x0; - if (fwrite(&fh, sizeof(fh), 1, aub_file) < 0) + if (fwrite(&fh, sizeof(fh), 1, aub_file) < 1) FAIL; /* Setup the GTT starting at main memory address zero (!): @@ -96,12 +96,12 @@ static void init_aubfile( FILE *aub_file ) bh.address = PGETBL_CTL; bh.length = 0x4; - if (fwrite(&bh, sizeof(bh), 1, aub_file) < 0) + if (fwrite(&bh, sizeof(bh), 1, aub_file) < 1) FAIL; data = 0x0 | PGETBL_ENABLED; - if (fwrite(&data, sizeof(data), 1, aub_file) < 0) + if (fwrite(&data, sizeof(data), 1, aub_file) < 1) FAIL; } @@ -128,7 +128,7 @@ static void init_aub_gtt( struct brw_context *brw, bh.address = start_offset / 4096 * 4; bh.length = size / 4096 * 4; - if (fwrite(&bh, sizeof(bh), 1, aub_file) < 0) + if (fwrite(&bh, sizeof(bh), 1, aub_file) < 1) FAIL; for (i = 0; i < size / 4096; i++) { @@ -136,7 +136,7 @@ static void init_aub_gtt( struct brw_context *brw, brw->next_free_page += 4096; - if (fwrite(&data, sizeof(data), 1, aub_file) < 0) + if (fwrite(&data, sizeof(data), 1, aub_file) < 1) FAIL; } @@ -149,10 +149,10 @@ static void write_block_header( FILE *aub_file, { sz = (sz + 3) & ~3; - if (fwrite(bh, sizeof(*bh), 1, aub_file) < 0) + if (fwrite(bh, sizeof(*bh), 1, aub_file) < 1) FAIL; - if (fwrite(data, sz, 1, aub_file) < 0) + if (fwrite(data, sz, 1, aub_file) < 1) FAIL; fflush(aub_file); @@ -162,7 +162,7 @@ static void write_block_header( FILE *aub_file, static void write_dump_bmp( FILE *aub_file, struct aub_dump_bmp *db ) { - if (fwrite(db, sizeof(*db), 1, aub_file) < 0) + if (fwrite(db, sizeof(*db), 1, aub_file) < 1) FAIL; fflush(aub_file); |