diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2011-04-06 13:05:44 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2011-04-06 13:05:44 (GMT) |
commit | a6cc2f3c23ebe5374eabe590cb06cb4c4b419dbc (patch) | |
tree | ee0613bd7e8d75ba4fd80811c1b4aac49b00d308 /generic/tclFCmd.c | |
parent | 5e4e04d0e675c6fa2f437398bcdcab674c0cbd04 (diff) | |
download | tcl-a6cc2f3c23ebe5374eabe590cb06cb4c4b419dbc.zip tcl-a6cc2f3c23ebe5374eabe590cb06cb4c4b419dbc.tar.gz tcl-a6cc2f3c23ebe5374eabe590cb06cb4c4b419dbc.tar.bz2 |
More generation of error codes (most platform-specific parts not already using
Tcl_PosixError).
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 \"", |