Skip to content

Commit

Permalink
doc: aliasing-test: close fd on write error
Browse files Browse the repository at this point in the history
If write fails, remember to close(fd) before returning.

Signed-off-by: Jesper Juhl <[email protected]>
Signed-off-by: Jiri Kosina <[email protected]>
  • Loading branch information
jjuhl authored and Jiri Kosina committed Sep 1, 2012
1 parent 7122bbb commit 5ffd27f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions Documentation/ia64/aliasing-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ static int read_rom(char *path)

rc = write(fd, "1", 2);
if (rc <= 0) {
close(fd);
perror("write");
return -1;
}
Expand Down

0 comments on commit 5ffd27f

Please sign in to comment.