Mercurial > hg > CbC > CbC_gcc
comparison libiberty/pex-common.c @ 111:04ced10e8804
gcc 7
author | kono |
---|---|
date | Fri, 27 Oct 2017 22:46:09 +0900 |
parents | f6334be47118 |
children | 84e7813d76e9 |
comparison
equal
deleted
inserted
replaced
68:561a7518be6b | 111:04ced10e8804 |
---|---|
1 /* Common code for executing a program in a sub-process. | 1 /* Common code for executing a program in a sub-process. |
2 Copyright (C) 2005, 2010 Free Software Foundation, Inc. | 2 Copyright (C) 2005-2017 Free Software Foundation, Inc. |
3 Written by Ian Lance Taylor <ian@airs.com>. | 3 Written by Ian Lance Taylor <ian@airs.com>. |
4 | 4 |
5 This file is part of the libiberty library. | 5 This file is part of the libiberty library. |
6 Libiberty is free software; you can redistribute it and/or | 6 Libiberty is free software; you can redistribute it and/or |
7 modify it under the terms of the GNU Library General Public | 7 modify it under the terms of the GNU Library General Public |
265 } | 265 } |
266 | 266 |
267 if (out < 0) | 267 if (out < 0) |
268 { | 268 { |
269 out = obj->funcs->open_write (obj, outname, | 269 out = obj->funcs->open_write (obj, outname, |
270 (flags & PEX_BINARY_OUTPUT) != 0); | 270 (flags & PEX_BINARY_OUTPUT) != 0, |
271 (flags & PEX_STDOUT_APPEND) != 0); | |
271 if (out < 0) | 272 if (out < 0) |
272 { | 273 { |
273 *err = errno; | 274 *err = errno; |
274 errmsg = "open temporary output file"; | 275 errmsg = "open temporary output file"; |
275 goto error_exit; | 276 goto error_exit; |
317 errdes = STDERR_FILE_NO; | 318 errdes = STDERR_FILE_NO; |
318 } | 319 } |
319 } | 320 } |
320 else | 321 else |
321 { | 322 { |
322 errdes = obj->funcs->open_write (obj, errname, | 323 errdes = obj->funcs->open_write (obj, errname, |
323 (flags & PEX_BINARY_ERROR) != 0); | 324 (flags & PEX_BINARY_ERROR) != 0, |
325 (flags & PEX_STDERR_APPEND) != 0); | |
324 if (errdes < 0) | 326 if (errdes < 0) |
325 { | 327 { |
326 *err = errno; | 328 *err = errno; |
327 errmsg = "open error file"; | 329 errmsg = "open error file"; |
328 goto error_exit; | 330 goto error_exit; |
621 pex_get_status_and_time (obj, 1, &errmsg, &err); | 623 pex_get_status_and_time (obj, 1, &errmsg, &err); |
622 } | 624 } |
623 | 625 |
624 if (obj->next_input_name_allocated) | 626 if (obj->next_input_name_allocated) |
625 free (obj->next_input_name); | 627 free (obj->next_input_name); |
626 if (obj->children != NULL) | 628 free (obj->children); |
627 free (obj->children); | 629 free (obj->status); |
628 if (obj->status != NULL) | 630 free (obj->time); |
629 free (obj->status); | |
630 if (obj->time != NULL) | |
631 free (obj->time); | |
632 | 631 |
633 if (obj->remove_count > 0) | 632 if (obj->remove_count > 0) |
634 { | 633 { |
635 int i; | 634 int i; |
636 | 635 |