Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cli: fix ignoring std{out,err} sync errors on windows #146

Merged
merged 2 commits into from
Feb 25, 2019

Conversation

Stebalien
Copy link
Member

@Stebalien Stebalien requested a review from keks as a code owner February 25, 2019 23:05
@ghost ghost assigned Stebalien Feb 25, 2019
@ghost ghost added the status/in-progress In progress label Feb 25, 2019
@Stebalien Stebalien requested a review from djdv February 25, 2019 23:18
const invalid_file_handle syscall.Errno = 0x6

func isErrnoNotSupported(err syscall.Errno) bool {
switch e {
Copy link
Contributor

Choose a reason for hiding this comment

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

e -> err

if !ok {
return false
}
return perr.Op == "sync" && isErrnoNotSupported(perr.Err)
Copy link
Contributor

Choose a reason for hiding this comment

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

Compiler is complaining about a lack of type assertion for perr

cannot convert perr.Err (type error) to type syscall.Errno: need type assertion

Apparently, windows returns "invalid file handle" and golang doesn't translate
this to EINVAL.

fixes ipfs/kubo#6021
@Stebalien Stebalien force-pushed the fix/sync-stderr-windows branch from 6834247 to 9d994fb Compare February 25, 2019 23:24
@Stebalien
Copy link
Member Author

(fixed)

Copy link
Contributor

@djdv djdv left a comment

Choose a reason for hiding this comment

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

Works on my machine seal of approval

@Stebalien Stebalien merged commit a83fda2 into master Feb 25, 2019
@Stebalien Stebalien deleted the fix/sync-stderr-windows branch February 25, 2019 23:39
@ghost ghost removed the status/in-progress In progress label Feb 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

command stderr error
2 participants