Lines 20-22
Link Here
|
20 |
|
20 |
|
21 |
/* determine pathname to use */ |
21 |
/* determine pathname to use */ |
22 |
if (path == NULL || *path == '\0') { |
22 |
if (path == NULL || *path == '\0') { |
|
|
23 |
@@ -43,17 +47,17 @@ |
24 |
/* expand a tilde style path */ |
25 |
if (*path == '~') |
26 |
if ((path = tildexpand(path)) == NULL) { |
27 |
- strcpy(TRET, "c_log: bad login id in path"); |
28 |
+ strcpy(Tcl_GetStringResult(interp), "c_log: bad login id in path"); |
29 |
return(-1); |
30 |
} |
31 |
|
32 |
/* open the session log */ |
33 |
if ((logfp = fopen(path, "a")) == NULL) { |
34 |
if (errno > sys_nerr) |
35 |
- sprintf(TRET, |
36 |
+ sprintf(Tcl_GetStringResult(interp), |
37 |
"c_log: can't open \"%s\": errno %d", path, errno); |
38 |
else |
39 |
- sprintf(TRET, |
40 |
+ sprintf(Tcl_GetStringResult(interp), |
41 |
"c_log: can't open \"%s\": %s", path, strerror(errno)); |
42 |
return(-1); |
43 |
} |
44 |
@@ -61,10 +65,10 @@ |
45 |
/* protect the logfile against others */ |
46 |
if (fchmod((int)(fileno(logfp)), 0600) != 0) { |
47 |
if (errno > sys_nerr) |
48 |
- sprintf(TRET, |
49 |
+ sprintf(Tcl_GetStringResult(interp), |
50 |
"c_log: can't fchmod \"%s\": errno %d", path, errno); |
51 |
else |
52 |
- sprintf(TRET, |
53 |
+ sprintf(Tcl_GetStringResult(interp), |
54 |
"c_log: can't fchmod \"%s\": %s", path, strerror(errno)); |
55 |
fclose(logfp); |
56 |
logfp = NULL; |
57 |
@@ -146,7 +150,7 @@ |
58 |
return(TCL_ERROR); |
59 |
} else { |
60 |
if (logging()) { |
61 |
- sprintf(TRET, "c_log: session logging already on"); |
62 |
+ sprintf(Tcl_GetStringResult(interp), "c_log: session logging already on"); |
63 |
return(TCL_ERROR); |
64 |
} else |
65 |
if (startsessionlog(interp, argv[1]) < 0) |