500 |
full_path[pkgdatadirlen] = '/'; |
full_path[pkgdatadirlen] = '/'; |
501 |
strcpy (full_path + pkgdatadirlen + 1, m4sugar); |
strcpy (full_path + pkgdatadirlen + 1, m4sugar); |
502 |
in = fopen (full_path, "r"); |
in = fopen (full_path, "r"); |
503 |
if (! in || fclose (in) != 0) |
if (! in) |
504 |
error (EXIT_FAILURE, errno, "%s", full_path); |
error (EXIT_FAILURE, errno, "%s", full_path); |
505 |
|
xfclose (in); |
506 |
strcpy (full_path + pkgdatadirlen + 1, skeleton); |
strcpy (full_path + pkgdatadirlen + 1, skeleton); |
507 |
|
|
508 |
/* Create an m4 subprocess connected to us via two pipes. */ |
/* Create an m4 subprocess connected to us via two pipes. */ |
540 |
|
|
541 |
fputs ("m4_wrap([m4_divert_pop(0)])\n", out); |
fputs ("m4_wrap([m4_divert_pop(0)])\n", out); |
542 |
fputs ("m4_divert_push(0)dnl\n", out); |
fputs ("m4_divert_push(0)dnl\n", out); |
|
if (ferror (out)) |
|
|
error (EXIT_FAILURE, 0, "pipe output error"); |
|
543 |
xfclose (out); |
xfclose (out); |
544 |
|
|
545 |
/* Read and process m4's output. */ |
/* Read and process m4's output. */ |
548 |
if (! in) |
if (! in) |
549 |
error (EXIT_FAILURE, errno, "fdopen"); |
error (EXIT_FAILURE, errno, "fdopen"); |
550 |
scan_skel (in); |
scan_skel (in); |
|
if (ferror (in)) |
|
|
error (EXIT_FAILURE, 0, "pipe input error"); |
|
551 |
xfclose (in); |
xfclose (in); |
552 |
reap_subpipe (pid, m4); |
reap_subpipe (pid, m4); |
553 |
timevar_pop (TV_M4); |
timevar_pop (TV_M4); |