comparison lib/csharpcomp.c @ 10197:d079dd7b69bc

Add termsigp argument to execute() and wait_process().
author Bruno Haible <bruno@clisp.org>
date Tue, 10 Jun 2008 17:38:39 +0200
parents bbbbbf4cd1c5
children e8d2c6fc33ad
comparison
equal deleted inserted replaced
10196:a59b1061e84a 10197:d079dd7b69bc
1 /* Compile a C# program. 1 /* Compile a C# program.
2 Copyright (C) 2003-2007 Free Software Foundation, Inc. 2 Copyright (C) 2003-2008 Free Software Foundation, Inc.
3 Written by Bruno Haible <bruno@clisp.org>, 2003. 3 Written by Bruno Haible <bruno@clisp.org>, 2003.
4 4
5 This program is free software: you can redistribute it and/or modify 5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 3 of the License, or 7 the Free Software Foundation; either version 3 of the License, or
81 81
82 argv[0] = "cscc"; 82 argv[0] = "cscc";
83 argv[1] = "--version"; 83 argv[1] = "--version";
84 argv[2] = NULL; 84 argv[2] = NULL;
85 exitstatus = execute ("cscc", "cscc", argv, false, false, true, true, 85 exitstatus = execute ("cscc", "cscc", argv, false, false, true, true,
86 true, false); 86 true, false, NULL);
87 cscc_present = (exitstatus == 0); 87 cscc_present = (exitstatus == 0);
88 cscc_tested = true; 88 cscc_tested = true;
89 } 89 }
90 90
91 if (cscc_present) 91 if (cscc_present)
149 printf ("%s\n", command); 149 printf ("%s\n", command);
150 free (command); 150 free (command);
151 } 151 }
152 152
153 exitstatus = execute ("cscc", "cscc", argv, false, false, false, false, 153 exitstatus = execute ("cscc", "cscc", argv, false, false, false, false,
154 true, true); 154 true, true, NULL);
155 155
156 for (i = 0; i < sources_count; i++) 156 for (i = 0; i < sources_count; i++)
157 if (argv[argc - sources_count + i] != sources[i]) 157 if (argv[argc - sources_count + i] != sources[i])
158 freea (argv[argc - sources_count + i]); 158 freea (argv[argc - sources_count + i]);
159 freea (argv); 159 freea (argv);
217 close (fd[0]); 217 close (fd[0]);
218 218
219 /* Remove zombie process from process list, and retrieve exit 219 /* Remove zombie process from process list, and retrieve exit
220 status. */ 220 status. */
221 exitstatus = 221 exitstatus =
222 wait_subprocess (child, "mcs", false, true, true, false); 222 wait_subprocess (child, "mcs", false, true, true, false, NULL);
223 if (exitstatus != 0) 223 if (exitstatus != 0)
224 mcs_present = false; 224 mcs_present = false;
225 } 225 }
226 mcs_tested = true; 226 mcs_tested = true;
227 } 227 }
330 if (line[1] != NULL) 330 if (line[1] != NULL)
331 free (line[1]); 331 free (line[1]);
332 fclose (fp); 332 fclose (fp);
333 333
334 /* Remove zombie process from process list, and retrieve exit status. */ 334 /* Remove zombie process from process list, and retrieve exit status. */
335 exitstatus = wait_subprocess (child, "mcs", false, false, true, true); 335 exitstatus =
336 wait_subprocess (child, "mcs", false, false, true, true, NULL);
336 337
337 for (i = 1 + (output_is_library ? 1 : 0); 338 for (i = 1 + (output_is_library ? 1 : 0);
338 i < 1 + (output_is_library ? 1 : 0) 339 i < 1 + (output_is_library ? 1 : 0)
339 + 1 + libdirs_count + libraries_count; 340 + 1 + libdirs_count + libraries_count;
340 i++) 341 i++)
406 close (fd[0]); 407 close (fd[0]);
407 408
408 /* Remove zombie process from process list, and retrieve exit 409 /* Remove zombie process from process list, and retrieve exit
409 status. */ 410 status. */
410 exitstatus = 411 exitstatus =
411 wait_subprocess (child, "csc", false, true, true, false); 412 wait_subprocess (child, "csc", false, true, true, false, NULL);
412 if (exitstatus != 0) 413 if (exitstatus != 0)
413 csc_present = false; 414 csc_present = false;
414 } 415 }
415 csc_tested = true; 416 csc_tested = true;
416 } 417 }
484 printf ("%s\n", command); 485 printf ("%s\n", command);
485 free (command); 486 free (command);
486 } 487 }
487 488
488 exitstatus = execute ("csc", "csc", argv, false, false, false, false, 489 exitstatus = execute ("csc", "csc", argv, false, false, false, false,
489 true, true); 490 true, true, NULL);
490 491
491 for (i = 2; i < 3 + libdirs_count + libraries_count; i++) 492 for (i = 2; i < 3 + libdirs_count + libraries_count; i++)
492 freea (argv[i]); 493 freea (argv[i]);
493 for (i = 0; i < sources_count; i++) 494 for (i = 0; i < sources_count; i++)
494 if (argv[argc - sources_count + i] != sources[i]) 495 if (argv[argc - sources_count + i] != sources[i])