Skip to content

Commit 1ccbeba

Browse files
fix: compile on Windows (#9284)
Fixes a compilation error on Windows, needed for ModusDB.
1 parent ee77e50 commit 1ccbeba

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

x/x.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ import (
3838
"strings"
3939
"sync"
4040
"sync/atomic"
41-
"syscall"
4241
"time"
4342

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

11271126
if times == 2 {
11281127
fmt.Printf("Retype %s password for %v:", strings.ToLower(pwdType), userid)
1129-
pd2, err := term.ReadPassword(syscall.Stdin)
1128+
pd2, err := term.ReadPassword(int(os.Stdin.Fd()))
11301129
if err != nil {
11311130
return "", errors.Wrapf(err, "while reading password")
11321131
}

0 commit comments

Comments
 (0)