Browse Source

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>
Jesper Juhl 13 years ago
parent
commit
5ffd27fa8d
1 changed files with 1 additions and 0 deletions
  1. 1 0
      Documentation/ia64/aliasing-test.c

+ 1 - 0
Documentation/ia64/aliasing-test.c

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