# os/linux: return error on EALREADY for connect\(\) and getsockoptError\(\) · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/2bfc6d14d500dcaf66b8ee7d24637e25e3795a5e)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: 2bfc6d14d500dcaf66b8ee7d24637e25e3795a5e

Requested commit: 2bfc6d14d500dcaf66b8ee7d24637e25e3795a5e

Commit: 2bfc6d14d500dcaf66b8ee7d24637e25e3795a5e

Tree: 590a0fd6101060b5b7e57ae160dfda3552bc2327

Author: lithdew

Committer: Isaac Freund

## Message

```
os/linux: return error on EALREADY for connect() and getsockoptError()

    When a connected socket file descriptor on Linux is re-acquired
    after being closed, through fuzz testing, it appears that a
    subsequent attempt to establish a connection with the file
    descriptor causes EALREADY to be reported.

    Instead of panicking, choose to return error.ConnectionPending
    to allow for users to handle this fairly rare case.

```

## Parents

- [83a2665772578f6262afc858613023738a7d25ef](https://git.cafe/gitcafe/zig/commit/83a2665772578f6262afc858613023738a7d25ef?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/2bfc6d14d500dcaf66b8ee7d24637e25e3795a5e?format=markdown)
