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>
This commit is contained in:
Jesper Juhl 2012-08-08 00:07:03 +02:00 committed by Jiri Kosina
parent 7122bbb0d1
commit 5ffd27fa8d

View File

@ -132,6 +132,7 @@ static int read_rom(char *path)
rc = write(fd, "1", 2); rc = write(fd, "1", 2);
if (rc <= 0) { if (rc <= 0) {
close(fd);
perror("write"); perror("write");
return -1; return -1;
} }