提交 5ffd27fa 编写于 作者: J Jesper Juhl 提交者: Jiri Kosina

doc: aliasing-test: close fd on write error

If write fails, remember to close(fd) before returning.
Signed-off-by: NJesper Juhl <jj@chaosbits.net>
Signed-off-by: NJiri Kosina <jkosina@suse.cz>
上级 7122bbb0
......@@ -132,6 +132,7 @@ static int read_rom(char *path)
rc = write(fd, "1", 2);
if (rc <= 0) {
close(fd);
perror("write");
return -1;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册