Skip to content
This repository has been archived by the owner on May 4, 2018. It is now read-only.

process: /dev/null ignored stdio if index < 3 #441

Closed
wants to merge 1 commit into from
Closed

process: /dev/null ignored stdio if index < 3 #441

wants to merge 1 commit into from

Conversation

indutny
Copy link
Contributor

@indutny indutny commented Jun 2, 2012

nt

@piscisaureus
Copy link

@bnoordhuis It looks good to me but I'd like you to take another look.

@piscisaureus
Copy link

I landed the test (with slight modifications) in 1cd9642

if (i == 0) {
use_fd = open("/dev/null", O_RDONLY);
} else {
use_fd = open("/dev/null", O_RDWR);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not wildly enthusiastic about the 5 levels of indent or the many if/then/else branches. Is there a way to flatten / simplify the code?

@bnoordhuis
Copy link
Contributor

Another thing, the commit log could be improved. Something like "unix: remap fds 0-2 to /dev/null if ignore flag set"

@indutny
Copy link
Contributor Author

indutny commented Jun 4, 2012

@bnoordhuis moved init loop to separate function (for fixing indentation levels), and changed commit message. Please review!

@bnoordhuis
Copy link
Contributor

LGTM

@indutny
Copy link
Contributor Author

indutny commented Jun 4, 2012

Can you please merge it then?

@bnoordhuis
Copy link
Contributor

Landed in a30e45f.

@bnoordhuis bnoordhuis closed this Jun 4, 2012
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants