summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2012-03-20 10:15:02 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2012-03-20 10:15:02 (GMT)
commit10f86a8692c0a3a978d81ff4ab06c6f04dde6d99 (patch)
tree2b91bafe7209fe7a322a5a7f9ec87572e868bf81 /win
parent23f5b19d027c7c6f2eec97dd900569b56a9087f7 (diff)
downloadtcl-10f86a8692c0a3a978d81ff4ab06c6f04dde6d99.zip
tcl-10f86a8692c0a3a978d81ff4ab06c6f04dde6d99.tar.gz
tcl-10f86a8692c0a3a978d81ff4ab06c6f04dde6d99.tar.bz2
[Bug 3288345] Wrong Tcl_StatBuf used on Cygwin
(backported from Tcl 8.5)
Diffstat (limited to 'win')
-rw-r--r--win/tclWinFile.c60
-rw-r--r--win/tclWinPort.h39
2 files changed, 3 insertions, 96 deletions
diff --git a/win/tclWinFile.c b/win/tclWinFile.c
index 4ed5a3d..2c6150f 100644
--- a/win/tclWinFile.c
+++ b/win/tclWinFile.c
@@ -1640,24 +1640,9 @@ TclpObjChdir(pathPtr)
{
int result;
CONST TCHAR *nativePath;
-#ifdef __CYGWIN__
- extern int cygwin_conv_to_posix_path
- _ANSI_ARGS_((CONST char *, char *));
- char posixPath[MAX_PATH+1];
- CONST char *path;
- Tcl_DString ds;
-#endif /* __CYGWIN__ */
nativePath = (CONST TCHAR *) Tcl_FSGetNativePath(pathPtr);
-#ifdef __CYGWIN__
- /* Cygwin chdir only groks POSIX path. */
- path = Tcl_WinTCharToUtf(nativePath, -1, &ds);
- cygwin_conv_to_posix_path(path, posixPath);
- result = (chdir(posixPath) == 0 ? 1 : 0);
- Tcl_DStringFree(&ds);
-#else /* __CYGWIN__ */
result = (*tclWinProcs->setCurrentDirectoryProc)(nativePath);
-#endif /* __CYGWIN__ */
if (result == 0) {
TclWinConvertError(GetLastError());
@@ -1666,51 +1651,6 @@ TclpObjChdir(pathPtr)
return 0;
}
-#ifdef __CYGWIN__
-/*
- *---------------------------------------------------------------------------
- *
- * TclpReadlink --
- *
- * This function replaces the library version of readlink().
- *
- * Results:
- * The result is a pointer to a string specifying the contents
- * of the symbolic link given by 'path', or NULL if the symbolic
- * link could not be read. Storage for the result string is
- * allocated in bufferPtr; the caller must call Tcl_DStringFree()
- * when the result is no longer needed.
- *
- * Side effects:
- * See readlink() documentation.
- *
- *---------------------------------------------------------------------------
- */
-
-char *
-TclpReadlink(path, linkPtr)
- CONST char *path; /* Path of file to readlink (UTF-8). */
- Tcl_DString *linkPtr; /* Uninitialized or free DString filled
- * with contents of link (UTF-8). */
-{
- char link[MAXPATHLEN];
- int length;
- char *native;
- Tcl_DString ds;
-
- native = Tcl_UtfToExternalDString(NULL, path, -1, &ds);
- length = readlink(native, link, sizeof(link)); /* INTL: Native. */
- Tcl_DStringFree(&ds);
-
- if (length < 0) {
- return NULL;
- }
-
- Tcl_ExternalToUtfDString(NULL, link, length, linkPtr);
- return Tcl_DStringValue(linkPtr);
-}
-#endif /* __CYGWIN__ */
-
/*
*----------------------------------------------------------------------
*
diff --git a/win/tclWinPort.h b/win/tclWinPort.h
index dd42340..aca3279 100644
--- a/win/tclWinPort.h
+++ b/win/tclWinPort.h
@@ -98,25 +98,6 @@ typedef DWORD_PTR * PDWORD_PTR;
#undef ENOTSUP
#define ENOTSUP -1030507
-/*
- * cygwin does not have this struct.
- */
-#ifdef __CYGWIN__
- struct _stat32i64 {
- dev_t st_dev;
- ino_t st_ino;
- unsigned short st_mode;
- short st_nlink;
- short st_uid;
- short st_gid;
- dev_t st_rdev;
- __int64 st_size;
- struct {long tv_sec;} st_atim;
- struct {long tv_sec;} st_mtim;
- struct {long tv_sec;} st_ctim;
- };
-#endif
-
/* Those codes, from Visual Studio 2010, conflict with other values */
#undef ENODATA
#undef ENOMSG
@@ -374,14 +355,6 @@ typedef DWORD_PTR * PDWORD_PTR;
# define environ _environ
#endif /* __BORLANDC__ */
-#ifdef __CYGWIN__
-/* On Cygwin, the environment is imported from the Cygwin DLL. */
- DLLIMPORT extern char **__cygwin_environ;
-# define environ __cygwin_environ
-# define putenv TclCygwinPutenv
-# define timezone _timezone
-#endif /* __CYGWIN__ */
-
/*
* There is no platform-specific panic routine for Windows in the Tcl internals.
*/
@@ -430,18 +403,12 @@ typedef DWORD_PTR * PDWORD_PTR;
* use by tclAlloc.c.
*/
-#ifdef __CYGWIN__
-# define TclpSysAlloc(size, isBin) malloc((size))
-# define TclpSysFree(ptr) free((ptr))
-# define TclpSysRealloc(ptr, size) realloc((ptr), (size))
-#else
-# define TclpSysAlloc(size, isBin) ((void*)HeapAlloc(GetProcessHeap(), \
+#define TclpSysAlloc(size, isBin) ((void*)HeapAlloc(GetProcessHeap(), \
(DWORD)0, (DWORD)size))
-# define TclpSysFree(ptr) (HeapFree(GetProcessHeap(), \
+#define TclpSysFree(ptr) (HeapFree(GetProcessHeap(), \
(DWORD)0, (HGLOBAL)ptr))
-# define TclpSysRealloc(ptr, size) ((void*)HeapReAlloc(GetProcessHeap(), \
+#define TclpSysRealloc(ptr, size) ((void*)HeapReAlloc(GetProcessHeap(), \
(DWORD)0, (LPVOID)ptr, (DWORD)size))
-#endif
/*
* The following defines map from standard socket names to our internal