|
From: <sv...@va...> - 2016-11-21 08:28:15
|
Author: mjw
Date: Mon Nov 21 08:28:07 2016
New Revision: 16148
Log:
Fix none/tests/pth_2sig.c build with (default) -std=gnu90.
error: ‘for’ loop initial declarations are only allowed in C99 mode
Modified:
trunk/none/tests/pth_2sig.c
Modified: trunk/none/tests/pth_2sig.c
==============================================================================
--- trunk/none/tests/pth_2sig.c (original)
+++ trunk/none/tests/pth_2sig.c Mon Nov 21 08:28:07 2016
@@ -14,7 +14,8 @@
int main(int argc, char **argv)
{
- for (int i = 0; i < 10; i++) {
+ int i;
+ for (i = 0; i < 10; i++) {
pthread_t slave;
if (pthread_create(&slave, 0, slavethread, 0)) {
perror("pthread_create");
@@ -26,7 +27,7 @@
switch (fork()) {
case 0: // child
sleep(2); // Should be enough to ensure (some) threads are created
- for (int i = 0; i < 20 && kill(pid, SIGTERM) == 0; i++)
+ for (i = 0; i < 20 && kill(pid, SIGTERM) == 0; i++)
;
exit(0);
case -1:
|