mirror of
https://github.com/albfan/miraclecast.git
synced 2025-02-12 12:41:53 +00:00
print dhcp commands
This commit is contained in:
parent
aa06803abf
commit
301e977bcb
1 changed files with 32 additions and 0 deletions
|
@ -414,6 +414,22 @@ static int supplicant_group_spawn_dhcp_server(struct supplicant_group *g,
|
|||
}
|
||||
argv[i] = NULL;
|
||||
|
||||
i = 0;
|
||||
size_t size = 0;
|
||||
while (argv[i]) {
|
||||
size += strlen(argv[i++]) + 1;
|
||||
}
|
||||
|
||||
gchar* dhcp_command = malloc(size);
|
||||
i = 0;
|
||||
strcpy(dhcp_command, argv[i++]);
|
||||
while (argv[i]) {
|
||||
strcat(dhcp_command, " ");
|
||||
strcat(dhcp_command, argv[i++]);
|
||||
}
|
||||
log_debug("dhcp command:%s", dhcp_command);
|
||||
g_free(dhcp_command);
|
||||
|
||||
if (execvpe(argv[0], argv, environ)< 0) {
|
||||
log_error("dhcp failed (%d): %m", errno);
|
||||
}
|
||||
|
@ -483,6 +499,22 @@ static int supplicant_group_spawn_dhcp_client(struct supplicant_group *g)
|
|||
}
|
||||
argv[i] = NULL;
|
||||
|
||||
i = 0;
|
||||
size_t size = 0;
|
||||
while (argv[i]) {
|
||||
size += strlen(argv[i++]) + 1;
|
||||
}
|
||||
|
||||
gchar* dhcp_command = malloc(size);
|
||||
i = 0;
|
||||
strcpy(dhcp_command, argv[i++]);
|
||||
while (argv[i]) {
|
||||
strcat(dhcp_command, " ");
|
||||
strcat(dhcp_command, argv[i++]);
|
||||
}
|
||||
log_debug("dhcp command:%s", dhcp_command);
|
||||
g_free(dhcp_command);
|
||||
|
||||
if (execvpe(argv[0], argv, environ) < 0) {
|
||||
log_error("dhcp failed (%d): %m", errno);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue