Package: pvm / 3.4.6-2

06-thread-safe-ctime.patch Patch series | download
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
--- a/tracer/trcutil.c
+++ b/tracer/trcutil.c
@@ -2904,7 +2904,7 @@
 
 	time( &t );
 
-	sprintf( tmp, "%s", ctime( &t ) );
+	ctime_r( &t, tmp );
 
 	result = tmp;
 
--- a/src/pvmd.c
+++ b/src/pvmd.c
@@ -1728,6 +1728,7 @@
 	gettimeofday(&tnow, (struct timezone*)0);
 	if (pvmdebmask || myhostpart) {
 		PVM_TIMET time_temp;
+		char retbuf[32];
 		pvmlogprintf("%s (%s) %s %s\n",
 				hosts->ht_hosts[hosts->ht_local]->hd_name,
 				inadport_decimal(&hosts->ht_hosts[hosts->ht_local]->hd_sad),
@@ -1735,7 +1736,8 @@
 				PVM_VER);
 		pvmlogprintf("ready ");
 		time_temp = (PVM_TIMET) tnow.tv_sec;
-		pvmlogprintf(ctime(&time_temp));
+		ctime_r(&time_temp, retbuf);
+		pvmlogprintf(retbuf);
 	}
 
 	/*