Skip to content
Snippets Groups Projects
  • Colin Walters's avatar
    abd37a47
    dirfd: Set initialized flag for iters · abd37a47
    Colin Walters authored
    And use it when deinitializing, to avoid calling `closedir(NULL)`.
    In practice, this doesn't matter, because `closedir` *does* handle `NULL`
    in glibc.
    
    However, I'm playing with the GCC `-fsanitize=undefined`, and it
    aborts because `closedir` is tagged as requiring a non-`NULL` pointer.
    abd37a47
    History
    dirfd: Set initialized flag for iters
    Colin Walters authored
    And use it when deinitializing, to avoid calling `closedir(NULL)`.
    In practice, this doesn't matter, because `closedir` *does* handle `NULL`
    in glibc.
    
    However, I'm playing with the GCC `-fsanitize=undefined`, and it
    aborts because `closedir` is tagged as requiring a non-`NULL` pointer.
glnx-dirfd.c 9.96 KiB