Skip to content

test_fdio assumes the two lowest free descriptors are free #63

Closed

Description

@linuxnow

tests/test_fdio.c:125 checks !is_open(before) && !is_open(before + 1), which holds only when nothing is open above the lowest free descriptor. A parent that leaves a descriptor open just above it (a lock on fd 9 in the combined test) makes the test fail with no fault in the library.

  • The test opens the descriptors it needs and checks those, or closes everything above stdio first, so it does not depend on what the parent left open.
  • A case that runs it with a stray descriptor open (e.g. 9) and passes.

Activity

  1. linuxnow commented on Nov 4, 2026

    @linuxnow
    ContributorAuthor

    Folded into #29.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions