mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 04:25:18 +00:00
commandhelper: Factor out printArguments
Signed-off-by: Tim Wiederhake <twiederh@redhat.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
parent
d23bc5506e
commit
99ceaffd15
@ -80,6 +80,15 @@ static struct Arguments *parseArguments(int argc, char** argv)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void printArguments(FILE *log, int argc, char** argv)
|
||||
{
|
||||
size_t i;
|
||||
|
||||
for (i = 1; i < argc; i++) {
|
||||
fprintf(log, "ARG:%s\n", argv[i]);
|
||||
}
|
||||
}
|
||||
|
||||
static int envsort(const void *a, const void *b)
|
||||
{
|
||||
const char *astr = *(const char**)a;
|
||||
@ -115,9 +124,7 @@ int main(int argc, char **argv) {
|
||||
if (!log || !args)
|
||||
goto cleanup;
|
||||
|
||||
for (i = 1; i < argc; i++) {
|
||||
fprintf(log, "ARG:%s\n", argv[i]);
|
||||
}
|
||||
printArguments(log, argc, argv);
|
||||
|
||||
for (n = 0; environ[n]; n++) {
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user