Skip to content
This repository has been archived by the owner on Feb 24, 2020. It is now read-only.

stage1/fly: clear FD_CLOEXEC only once #3521

Merged
merged 1 commit into from
Jan 11, 2017

Conversation

lucab
Copy link
Member

@lucab lucab commented Jan 9, 2017

stage1-fly was previously toggling FD_CLOEXEC on RKT_LOCK_FD multiple
times:

  1. setting it at first
  2. clearing it before exec()
  3. setting it again after exec()

This commit just clears it once, as exec() is the very last stage1 step
and we either exit-fail or never return after that.

stage1-fly was previously toggling `FD_CLOEXEC` on `RKT_LOCK_FD` multiple
times:
 1. setting it at first
 2. clearing it before exec()
 3. setting it again after exec()

This commit just clears it once, as exec() is the very last stage1 step
and we either exit-fail or never return after that.
@squeed
Copy link
Contributor

squeed commented Jan 10, 2017

LGTM. Looks like we use the same wrapper around exec in the other stage1, if you feel like fixing.

@lucab
Copy link
Member Author

lucab commented Jan 10, 2017

The story for other stage1 is a bit more complex and traces back to #628. In short, there may be other fork/exec involved for which we need FD_CLOEXEC. But I should re-check at some point, as that PR is quite old and the description in there doesn't completely match my current understanding.

/cc @jonboulle

@jonboulle
Copy link
Contributor

@lucab maybe just file a follow up for that one?

@lucab
Copy link
Member Author

lucab commented Jan 10, 2017

After a second pass, the other stage1s look fine as they are. I think I just misread one of the original comments, which left me wondering.

@lucab lucab merged commit c2f3aa4 into rkt:master Jan 11, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants