Skip to content

LOW PRIORITY: Test to close sio_port descriptor in exit_hander() makes a false assumption #14

@dcnewman

Description

@dcnewman

In gpx-main.c/exit_handler(), the sio_port descriptor is only closed if it is > 2. That assumes that when it was opened, it was assigned a value of 3 or more. That won't be the case when the process is exec() and forked() in a context that doesn't open one or more of stdin, stdout, and stderr. That is, that test assumes that stdin=0, stdout=1, and stderr=3. That's not always true.

The test should be changed to "if(sio_port >= 0) close(sio_port);".

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions