maint: xfdopen, and scope reduction.

* src/files.h, src/files.c (xfdopen): New.
* src/output.c (output_skeleton): Use it.
Reduce the scope of argv.
This commit is contained in:
Akim Demaille
2012-06-15 11:56:13 +02:00
parent aed41cf9a0
commit 22539284f3
3 changed files with 18 additions and 13 deletions

View File

@@ -134,6 +134,15 @@ xfclose (FILE *ptr)
}
FILE *
xfdopen (int fd, char const *mode)
{
FILE *res = fdopen (fd, mode);
if (! res)
error (EXIT_FAILURE, get_errno (), "fdopen");
return res;
}
/*------------------------------------------------------------------.
| Compute ALL_BUT_EXT, ALL_BUT_TAB_EXT and output files extensions. |
`------------------------------------------------------------------*/