Commit 5ffd27fa8d7950a3c2136100860273e6ff2605e0

Authored by Jesper Juhl
Committed by Jiri Kosina
1 parent 7122bbb0d1

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>

Showing 1 changed file with 1 additions and 0 deletions Side-by-side Diff

Documentation/ia64/aliasing-test.c
... ... @@ -132,6 +132,7 @@
132 132  
133 133 rc = write(fd, "1", 2);
134 134 if (rc <= 0) {
  135 + close(fd);
135 136 perror("write");
136 137 return -1;
137 138 }