diff options
Diffstat (limited to 'util/nvmutil/lib')
| -rw-r--r-- | util/nvmutil/lib/file.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/util/nvmutil/lib/file.c b/util/nvmutil/lib/file.c index 30694623..a0313405 100644 --- a/util/nvmutil/lib/file.c +++ b/util/nvmutil/lib/file.c @@ -2032,9 +2032,34 @@ fs_resolve_at(int dirfd, const char *path, int flags) if (nextfd < 0) goto err; +/* +don't close fd. +it's used next by a few functions. +this results in a fd leak, but +makes the code work: +in practise, your program +will free all descriptors +on exit + +what we need to do is figure out a proper +system of storing descriptors, +and freeing them when it's safe; +see how this function is called +and whatt calls those and you see what i mean + +who owns what is currently not consistent. +needs rework. + +this will be fixed at a later date. +justt leaving thtis in here for future me. + +with this uncommented, i always just get +"Bad file descriptor" error: + saved_close_errno = errno; (void) close_on_eintr(dirfd); errno = saved_close_errno; +*/ dirfd = nextfd; nextfd = -1; |
