diff options
| author | donal.k.fellows@manchester.ac.uk <dkf> | 2003-03-07 11:38:28 (GMT) |
|---|---|---|
| committer | donal.k.fellows@manchester.ac.uk <dkf> | 2003-03-07 11:38:28 (GMT) |
| commit | d80d210336cb5a9c653edd7d746ad7fcae7d38a7 (patch) | |
| tree | bf89486e00b574d0d40c856f9ad07fc0db28fb9e | |
| parent | 588a7c1117a8e8c4102df200271058863e32f43d (diff) | |
| download | tcl-d80d210336cb5a9c653edd7d746ad7fcae7d38a7.zip tcl-d80d210336cb5a9c653edd7d746ad7fcae7d38a7.tar.gz tcl-d80d210336cb5a9c653edd7d746ad7fcae7d38a7.tar.bz2 | |
* generic/tclCmdAH.c (Tcl_FileObjCmd): Fix the setting of a file's mtime
and atime on 64-bit platforms. [Bug #698146]
| -rw-r--r-- | ChangeLog | 5 | ||||
| -rw-r--r-- | generic/tclCmdAH.c | 26 |
2 files changed, 24 insertions, 7 deletions
@@ -1,3 +1,8 @@ +2003-03-07 Donal K. Fellows <fellowsd@cs.man.ac.uk> + + * generic/tclCmdAH.c (Tcl_FileObjCmd): Fix the setting of a file's + mtime and atime on 64-bit platforms. [Bug #698146] + 2003-03-06 Mo DeJong <mdejong@users.sourceforge.net> * tests/io.test: Doh! Undo accidental commenting diff --git a/generic/tclCmdAH.c b/generic/tclCmdAH.c index 2992367..03c1c38 100644 --- a/generic/tclCmdAH.c +++ b/generic/tclCmdAH.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclCmdAH.c,v 1.27 2002/07/02 12:16:05 vincentdarley Exp $ + * RCS: @(#) $Id: tclCmdAH.c,v 1.28 2003/03/07 11:38:29 dkf Exp $ */ #include "tclInt.h" @@ -835,11 +835,17 @@ Tcl_FileObjCmd(dummy, interp, objc, objv) return TCL_ERROR; } if (objc == 4) { - if (Tcl_GetLongFromObj(interp, objv[3], - (long*)(&buf.st_atime)) != TCL_OK) { + /* + * Need separate variable for reading longs from an + * object on 64-bit platforms. [Bug #698146] + */ + long newTime; + + if (Tcl_GetLongFromObj(interp, objv[3], &newTime) != TCL_OK) { return TCL_ERROR; } - tval.actime = buf.st_atime; + + tval.actime = newTime; tval.modtime = buf.st_mtime; if (Tcl_FSUtime(objv[2], &tval) != 0) { Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), @@ -1071,12 +1077,18 @@ Tcl_FileObjCmd(dummy, interp, objc, objv) return TCL_ERROR; } if (objc == 4) { - if (Tcl_GetLongFromObj(interp, objv[3], - (long*)(&buf.st_mtime)) != TCL_OK) { + /* + * Need separate variable for reading longs from an + * object on 64-bit platforms. [Bug #698146] + */ + long newTime; + + if (Tcl_GetLongFromObj(interp, objv[3], &newTime) != TCL_OK) { return TCL_ERROR; } + tval.actime = buf.st_atime; - tval.modtime = buf.st_mtime; + tval.modtime = newTime; if (Tcl_FSUtime(objv[2], &tval) != 0) { Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), "could not set modification time for file \"", |
