Skip to content

Commit

Permalink
fix: compile on Windows (#9284)
Browse files Browse the repository at this point in the history
Fixes a compilation error on Windows, needed for ModusDB.
  • Loading branch information
mattjohnsonpint authored Jan 23, 2025
1 parent ee77e50 commit 1ccbeba
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions x/x.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ import (
"strings"
"sync"
"sync/atomic"
"syscall"
"time"

"github.com/dustin/go-humanize"
Expand Down Expand Up @@ -1117,7 +1116,7 @@ func AskUserPassword(userid string, pwdType string, times int) (string, error) {
AssertTrue(pwdType == "Current" || pwdType == "New")
// ask for the user's password
fmt.Printf("%s password for %v:", pwdType, userid)
pd, err := term.ReadPassword(syscall.Stdin)
pd, err := term.ReadPassword(int(os.Stdin.Fd()))
if err != nil {
return "", errors.Wrapf(err, "while reading password")
}
Expand All @@ -1126,7 +1125,7 @@ func AskUserPassword(userid string, pwdType string, times int) (string, error) {

if times == 2 {
fmt.Printf("Retype %s password for %v:", strings.ToLower(pwdType), userid)
pd2, err := term.ReadPassword(syscall.Stdin)
pd2, err := term.ReadPassword(int(os.Stdin.Fd()))
if err != nil {
return "", errors.Wrapf(err, "while reading password")
}
Expand Down

0 comments on commit 1ccbeba

Please sign in to comment.