Skip to content

Shared file descriptor is closed prematurely #44

Closed
@josephlr

Description

Here, we create a File from a raw fd. However, as this object is created on the stack, at the endo the function, the file will be dropped, and thus closed.

This means that on systems using a shared FD, the second call to getrandom will fail. This can be fixed by just storing a File instead of a RawFd in static memory.

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