diff options
author | dkf <dkf@noemail.net> | 2011-04-06 13:05:44 (GMT) |
---|---|---|
committer | dkf <dkf@noemail.net> | 2011-04-06 13:05:44 (GMT) |
commit | 6dad0c97b49eccfc6dd9fe71b86f00d107df6225 (patch) | |
tree | ee0613bd7e8d75ba4fd80811c1b4aac49b00d308 /generic/tclFCmd.c | |
parent | 2c172f5ae932be65a8e8f813890d3d1a3c02ea7a (diff) | |
download | tcl-6dad0c97b49eccfc6dd9fe71b86f00d107df6225.zip tcl-6dad0c97b49eccfc6dd9fe71b86f00d107df6225.tar.gz tcl-6dad0c97b49eccfc6dd9fe71b86f00d107df6225.tar.bz2 |
More generation of error codes (most platform-specific parts not already using
Tcl_PosixError).
FossilOrigin-Name: 1b095ad294cc30f692b20d00970574897298b030
Diffstat (limited to 'generic/tclFCmd.c')
-rw-r--r-- | generic/tclFCmd.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/generic/tclFCmd.c b/generic/tclFCmd.c index c3a0a5e..e9176ca 100644 --- a/generic/tclFCmd.c +++ b/generic/tclFCmd.c @@ -1060,6 +1060,7 @@ TclFileAttrsCmd( Tcl_AppendResult(interp, "bad option \"", TclGetString(objv[0]), "\", there are no file attributes in this filesystem.", NULL); + Tcl_SetErrorCode(interp, "TCL","OPERATION","FATTR","NONE", NULL); goto end; } @@ -1086,6 +1087,7 @@ TclFileAttrsCmd( Tcl_AppendResult(interp, "bad option \"", TclGetString(objv[0]), "\", there are no file attributes in this filesystem.", NULL); + Tcl_SetErrorCode(interp, "TCL","OPERATION","FATTR","NONE", NULL); goto end; } @@ -1100,6 +1102,8 @@ TclFileAttrsCmd( if (i + 1 == objc) { Tcl_AppendResult(interp, "value for \"", TclGetString(objv[i]), "\" missing", NULL); + Tcl_SetErrorCode(interp, "TCL", "OPERATION", "FATTR", + "NOVALUE", NULL); goto end; } if (Tcl_FSFileAttrsSet(interp, index, filePtr, @@ -1213,6 +1217,7 @@ TclFileLinkCmd( Tcl_AppendResult(interp, "could not create new link \"", TclGetString(objv[index]), "\": that path already exists", NULL); + Tcl_PosixError(interp); } else if (errno == ENOENT) { /* * There are two cases here: either the target doesn't exist, @@ -1232,11 +1237,14 @@ TclFileLinkCmd( Tcl_AppendResult(interp, "could not create new link \"", TclGetString(objv[index]), "\": no such file or directory", NULL); + Tcl_PosixError(interp); } else { Tcl_AppendResult(interp, "could not create new link \"", TclGetString(objv[index]), "\": target \"", TclGetString(objv[index+1]), "\" doesn't exist", NULL); + errno = ENOENT; + Tcl_PosixError(interp); } } else { Tcl_AppendResult(interp, "could not create new link \"", |