Index: src/common/tuklib_open_stdxxx.c |
=================================================================== |
--- src/common/tuklib_open_stdxxx.c (revision 87706) |
+++ src/common/tuklib_open_stdxxx.c (working copy) |
@@ -39,12 +39,14 @@ |
| (i == 0 ? O_WRONLY : O_RDONLY)); |
if (fd != i) { |
+ if (fd != -1) |
+ (void)close(fd); |
+ |
// Something went wrong. Exit with the |
// exit status we were given. Don't try |
// to print an error message, since stderr |
// may very well be non-existent. This |
// error should be extremely rare. |
- (void)close(fd); |
exit(err_status); |
} |
} |