1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
|
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
|
-
+
-
+
|
return mode;
error:
*modeFlagsPtr = 0;
if (interp != NULL) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"illegal access mode \"%s\"", modeString));
Tcl_SetErrorCode(interp, "TCL", "OPENMODE", "INVALID", (char *)NULL);
TclSetErrorCode(interp, "TCL", "OPENMODE", "INVALID");
}
return -1;
}
/*
* The access modes are specified as a list of POSIX modes like O_CREAT.
*
* Tcl_SplitList must work correctly when interp is NULL.
*/
if (Tcl_SplitList(interp, modeString, &modeArgc, &modeArgv) != TCL_OK) {
invAccessMode:
if (interp != NULL) {
Tcl_AddErrorInfo(interp,
"\n while processing open access modes \"");
Tcl_AddErrorInfo(interp, modeString);
Tcl_AddErrorInfo(interp, "\"");
Tcl_SetErrorCode(interp, "TCL", "OPENMODE", "INVALID", (char *)NULL);
TclSetErrorCode(interp, "TCL", "OPENMODE", "INVALID");
}
if (modeArgv) {
Tcl_Free((void *)modeArgv);
}
return -1;
}
|
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
|
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
|
-
+
|
Tcl_Interp *interp) /* Interpreter to set the errorCode of */
{
const char *id, *msg;
msg = Tcl_ErrnoMsg(errno);
id = Tcl_ErrnoId();
if (interp) {
Tcl_SetErrorCode(interp, "POSIX", id, msg, (char *)NULL);
TclSetErrorCode(interp, "POSIX", id, msg);
}
return msg;
}
/*
*----------------------------------------------------------------------
*
|