Tcl Source Code

Check-in [b3cc1e62a2]
Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2018 Conference, Houston/TX, US, Oct 15-19
Send your abstracts to tclconference@googlegroups.com
or submit via the online form by Aug 20.

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:merge 8.7
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | dgp-sebres-timerate-review
Files: files | file ages | folders
SHA3-256:b3cc1e62a2a6ab669d3d53694f82ea0022056499a4a07b44b52a2df307172f7c
User & Date: dgp 2018-07-11 17:48:31
Context
2018-07-11
17:48
merge 8.7 Leaf check-in: b3cc1e62a2 user: dgp tags: dgp-sebres-timerate-review
2018-07-10
08:19
amend to [1830f9f520e2abdd], fixed package.test if built without test - avoids test file error: pack... check-in: 55e4fbd950 user: sebres tags: core-8-branch
2018-07-09
14:53
merge 8.7 check-in: d5870fa9fd user: dgp tags: dgp-sebres-timerate-review
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to generic/tclFCmd.c.

236
237
238
239
240
241
242


243
244


245
246
247
248
249
250
251
...
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288


289
290
291
292
293
294
295
	Tcl_IncrRefCount(split);
	if (pobjc == 0) {
	    errno = ENOENT;
	    errfile = objv[i];
	    break;
	}
	for (j = 0; j < pobjc; j++) {


	    target = Tcl_FSJoinPath(split, j + 1);
	    Tcl_IncrRefCount(target);



	    /*
	     * Call Tcl_FSStat() so that if target is a symlink that points to
	     * a directory we will create subdirectories in that directory.
	     */

	    if (Tcl_FSStat(target, &statBuf) == 0) {
................................................................................
	    } else if (Tcl_FSCreateDirectory(target) != TCL_OK) {
		/*
		 * Create might have failed because of being in a race
		 * condition with another process trying to create the same
		 * subdirectory.
		 */

		if (errno != EEXIST) {
		    errfile = target;
		    goto done;
		} else if ((Tcl_FSStat(target, &statBuf) == 0)
			&& S_ISDIR(statBuf.st_mode)) {
		    /*
		     * It is a directory that wasn't there before, so keep
		     * going without error.
		     */

		    Tcl_ResetResult(interp);
		} else {
		    errfile = target;
		    goto done;
		}
	    }



	    /*
	     * Forget about this sub-path.
	     */

	    Tcl_DecrRefCount(target);
	    target = NULL;
	}







>
>


>
>







 







|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
>
>







236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
...
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
	Tcl_IncrRefCount(split);
	if (pobjc == 0) {
	    errno = ENOENT;
	    errfile = objv[i];
	    break;
	}
	for (j = 0; j < pobjc; j++) {
	    int errCount = 2;

	    target = Tcl_FSJoinPath(split, j + 1);
	    Tcl_IncrRefCount(target);

	createDir:

	    /*
	     * Call Tcl_FSStat() so that if target is a symlink that points to
	     * a directory we will create subdirectories in that directory.
	     */

	    if (Tcl_FSStat(target, &statBuf) == 0) {
................................................................................
	    } else if (Tcl_FSCreateDirectory(target) != TCL_OK) {
		/*
		 * Create might have failed because of being in a race
		 * condition with another process trying to create the same
		 * subdirectory.
		 */

		if (errno == EEXIST) {
		    /* Be aware other workers could delete it immediately after
		     * creation, so give this worker still one chance (repeat once),
		     * see [270f78ca95] for description of the race-condition.
		     * Don't repeat the create always (to avoid endless loop). */
		    if (--errCount > 0) {
			goto createDir;
		    }
		    /* Already tried, with delete in-between directly after
		     * creation, so just continue (assume created successful). */
		    goto nextPart;
		}

		/* return with error */
		errfile = target;
		goto done;
	    }

	nextPart:
	    /*
	     * Forget about this sub-path.
	     */

	    Tcl_DecrRefCount(target);
	    target = NULL;
	}

Changes to tests/package.test.

19
20
21
22
23
24
25
26
27
28
29
30
31
32
33

::tcltest::loadTestedCommands
catch [list package require -exact Tcltest [info patchlevel]]

# Do all this in a slave interp to avoid garbaging the package list
set i [interp create]
tcltest::loadIntoSlaveInterpreter $i {*}$argv
load {} Tcltest $i
interp eval $i {
namespace import -force ::tcltest::*
#package forget {*}[package names]
set oldPkgUnknown [package unknown]
package unknown {}
set oldPath $auto_path
set auto_path ""







|







19
20
21
22
23
24
25
26
27
28
29
30
31
32
33

::tcltest::loadTestedCommands
catch [list package require -exact Tcltest [info patchlevel]]

# Do all this in a slave interp to avoid garbaging the package list
set i [interp create]
tcltest::loadIntoSlaveInterpreter $i {*}$argv
catch [list load {} Tcltest $i]
interp eval $i {
namespace import -force ::tcltest::*
#package forget {*}[package names]
set oldPkgUnknown [package unknown]
package unknown {}
set oldPath $auto_path
set auto_path ""