Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
03526597
Commit
03526597
authored
Apr 14, 2010
by
Alex Brainman
Committed by
Russ Cox
Apr 14, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
os, syscall: mingw bug fixes
R=rsc CC=golang-dev
https://golang.org/cl/815044
parent
6aad4191
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
14 deletions
+11
-14
file_mingw.go
src/pkg/os/file_mingw.go
+1
-1
stat_mingw.go
src/pkg/os/stat_mingw.go
+1
-2
syscall_mingw.go
src/pkg/syscall/syscall_mingw.go
+9
-11
No files found.
src/pkg/os/file_mingw.go
View file @
03526597
...
...
@@ -55,7 +55,7 @@ func Open(name string, flag int, perm int) (file *File, err Error) {
if
e
==
nil
{
return
r
,
nil
}
r
,
e
=
openFile
(
name
,
flag
|
syscall
.
O_CLOEXEC
,
perm
)
r
,
e
=
openFile
(
name
,
flag
,
perm
)
if
e
==
nil
{
return
r
,
nil
}
...
...
src/pkg/os/stat_mingw.go
View file @
03526597
...
...
@@ -10,8 +10,7 @@ func fileInfoFromStat(name string, fi *FileInfo, lstat, stat *syscall.Stat_t) *F
fi
.
Mode
=
0
if
stat
.
Windata
.
FileAttributes
==
syscall
.
FILE_ATTRIBUTE_DIRECTORY
{
fi
.
Mode
=
fi
.
Mode
|
syscall
.
S_IFDIR
}
if
stat
.
Windata
.
FileAttributes
==
syscall
.
FILE_ATTRIBUTE_NORMAL
{
}
else
{
fi
.
Mode
=
fi
.
Mode
|
syscall
.
S_IFREG
}
if
stat
.
Windata
.
FileAttributes
==
syscall
.
FILE_ATTRIBUTE_READONLY
{
...
...
src/pkg/syscall/syscall_mingw.go
View file @
03526597
...
...
@@ -132,21 +132,19 @@ func Open(path string, mode int, perm int) (fd int, errno int) {
if
len
(
path
)
==
0
{
return
-
1
,
ERROR_FILE_NOT_FOUND
}
var
access
,
sharemode
uint32
switch
{
case
mode
&
O_CREAT
!=
0
:
access
=
GENERIC_READ
|
GENERIC_WRITE
sharemode
=
0
case
mode
&
O_RDWR
==
O_RDONLY
:
var
access
uint32
switch
mode
&
(
O_RDONLY
|
O_WRONLY
|
O_RDWR
)
{
case
O_RDONLY
:
access
=
GENERIC_READ
sharemode
=
FILE_SHARE_READ
case
mode
&
O_RDWR
==
O_WRONLY
:
case
O_WRONLY
:
access
=
GENERIC_WRITE
sharemode
=
FILE_SHARE_READ
case
mode
&
O_RDWR
==
O_RDWR
:
case
O_RDWR
:
access
=
GENERIC_READ
|
GENERIC_WRITE
sharemode
=
FILE_SHARE_READ
|
FILE_SHARE_WRITE
}
if
mode
&
O_CREAT
!=
0
{
access
|=
GENERIC_WRITE
}
sharemode
:=
uint32
(
FILE_SHARE_READ
|
FILE_SHARE_WRITE
)
var
createmode
uint32
switch
{
case
mode
&
O_CREAT
!=
0
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment