diff options
author | oehhar <harald.oehlmann@elmicron.de> | 2014-02-11 08:53:33 (GMT) |
---|---|---|
committer | oehhar <harald.oehlmann@elmicron.de> | 2014-02-11 08:53:33 (GMT) |
commit | 38e56569f541a17fd0445bc3619d66e985e823db (patch) | |
tree | 03bd9ea1a62464856e300f703bcae2066e7f4afc /win | |
parent | ae4d117a365dafdbed3dc81b3fb8434a7d9d7514 (diff) | |
download | tcl-38e56569f541a17fd0445bc3619d66e985e823db.zip tcl-38e56569f541a17fd0445bc3619d66e985e823db.tar.gz tcl-38e56569f541a17fd0445bc3619d66e985e823db.tar.bz2 |
Changed position of flag evaluation as proposed by Phil Hoffmanbug_2413550
Diffstat (limited to 'win')
-rw-r--r-- | win/tclWinChan.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/win/tclWinChan.c b/win/tclWinChan.c index 19e3655..6d480a8 100644 --- a/win/tclWinChan.c +++ b/win/tclWinChan.c @@ -886,24 +886,6 @@ TclpOpenFileChannel( } /* - * If the file is being created, get the file attributes from the - * permissions argument, else use the existing file attributes. - */ - - if (mode & O_CREAT) { - if (permissions & S_IWRITE) { - flags = FILE_ATTRIBUTE_NORMAL; - } else { - flags = FILE_ATTRIBUTE_READONLY; - } - } else { - flags = (*tclWinProcs->getFileAttributesProc)(nativeName); - if (flags == 0xFFFFFFFF) { - flags = 0; - } - } - - /* * [2413550] Avoid double-open of serial ports on Windows * Special handling for Windows serial ports by a "name-hint" * to directly open it with the OVERLAPPED flag set. @@ -931,6 +913,24 @@ TclpOpenFileChannel( return channel; } /* + * If the file is being created, get the file attributes from the + * permissions argument, else use the existing file attributes. + */ + + if (mode & O_CREAT) { + if (permissions & S_IWRITE) { + flags = FILE_ATTRIBUTE_NORMAL; + } else { + flags = FILE_ATTRIBUTE_READONLY; + } + } else { + flags = (*tclWinProcs->getFileAttributesProc)(nativeName); + if (flags == 0xFFFFFFFF) { + flags = 0; + } + } + + /* * Set up the file sharing mode. We want to allow simultaneous access. */ |