Skip to content

Commit 5ffd27f

Browse files
jjuhlJiri Kosina
authored andcommitted
doc: aliasing-test: close fd on write error
If write fails, remember to close(fd) before returning. Signed-off-by: Jesper Juhl <jj@chaosbits.net> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
1 parent 7122bbb commit 5ffd27f

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

‎Documentation/ia64/aliasing-test.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ static int read_rom(char *path)
132132

133133
rc = write(fd, "1", 2);
134134
if (rc <= 0) {
135+
close(fd);
135136
perror("write");
136137
return -1;
137138
}

0 commit comments

Comments
 (0)