summaryrefslogtreecommitdiff
blob: 3a2a28ce4a2b3e27cab9b07594874682a03085f0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
 src/cmds/qstat.c                | 20 +++++++++++++++++++-
 src/scheduler.tcl/pbs_tclWrap.c | 13 +++++++++++++
 2 files changed, 32 insertions(+), 1 deletion(-)

diff --git a/src/cmds/qstat.c b/src/cmds/qstat.c
index f275cf8..23414b8 100644
--- a/src/cmds/qstat.c
+++ b/src/cmds/qstat.c
@@ -2203,8 +2203,13 @@ tcl_init(void)
 
   if (Tcl_Init(interp) == TCL_ERROR)
     {
+#if TCL_MAJOR_VERSION <=8 && TCL_MINOR_VERSION < 6
     fprintf(stderr, "Tcl_Init error: %s",
             interp->result);
+#else
+    fprintf(stderr, "Tcl_Init error: %s",
+            Tcl_GetStringResult(interp));
+#endif
     }
 
 #if TCLX
@@ -2216,8 +2221,14 @@ tcl_init(void)
   if (Tclx_Init(interp) == TCL_ERROR)
     {
 #endif
+
+#if TCL_MAJOR_VERSION <=8 && TCL_MINOR_VERSION < 6
     fprintf(stderr, "Tclx_Init error: %s",
             interp->result);
+#else
+    fprintf(stderr, "Tclx_Init error: %s",
+            Tcl_GetStringResult(interp));
+#endif
     }
 
 #endif /* TCLX */
@@ -2328,15 +2339,22 @@ void tcl_run(
 
   if (f_opt && Tcl_EvalFile(interp, script) != TCL_OK)
     {
-    char *trace;
+    const char *trace;
 
     trace = (char *)Tcl_GetVar(interp, "errorInfo", 0);
 
     if (trace == NULL)
+#if TCL_MAJOR_VERSION <=8 && TCL_MINOR_VERSION < 6
       trace = interp->result;
 
     fprintf(stderr, "%s: TCL error @ line %d: %s\n",
             script, interp->errorLine, trace);
+#else
+      trace = Tcl_GetStringResult(interp);
+
+    fprintf(stderr, "%s: TCL error @ line %d: %s\n",
+            script, Tcl_GetErrorLine(interp), trace);
+#endif
     }
 
   Tcl_DeleteInterp(interp);
diff --git a/src/scheduler.tcl/pbs_tclWrap.c b/src/scheduler.tcl/pbs_tclWrap.c
index 3eea0b0..7d0d610 100644
--- a/src/scheduler.tcl/pbs_tclWrap.c
+++ b/src/scheduler.tcl/pbs_tclWrap.c
@@ -935,8 +935,13 @@ int PBS_ReRun(
 
   if (argc != 2)
     {
+#if TCL_MAJOR_VERSION <=8 && TCL_MINOR_VERSION < 6
     sprintf(interp->result,
             "%s: wrong # args: job_id", argv[0]);
+#else
+    Tcl_SetObjResult(interp, Tcl_ObjPrintf(
+            "%s: wrong # args: job_id", argv[0]));
+#endif
     return TCL_ERROR;
     }
 
@@ -947,11 +952,19 @@ int PBS_ReRun(
     return TCL_OK;
     }
 
+#if TCL_MAJOR_VERSION <=8 && TCL_MINOR_VERSION < 6
   interp->result = strdup("0");
+#else
+  Tcl_SetResult(interp, "0", TCL_STATIC);
+#endif
 
   if (pbs_rerunjob_err(connector, strdup(argv[1]), extend, &local_errno))
     {
+#if TCL_MAJOR_VERSION <=8 && TCL_MINOR_VERSION < 6
     interp->result = strdup("-1");
+#else
+    Tcl_SetResult(interp, "-1", TCL_STATIC);
+#endif
     msg = pbs_geterrmsg(connector);
     sprintf(log_buffer, "%s (%d)", msg ? msg : fail, local_errno);
     log_err(-1, argv[0], log_buffer);