Create socket directly from ctl_connect()

Signed-off-by: Adrien Gallouët <adrien@gallouet.fr>
This commit is contained in:
Adrien Gallouët
2018-02-28 08:18:18 +00:00
parent ff5b966866
commit f95aaef092
5 changed files with 29 additions and 20 deletions

View File

@@ -127,19 +127,13 @@ gt_set(int argc, char **argv)
if (argz(pathz, argc, argv))
return 1;
int fd = ctl_create("/run/" PACKAGE_NAME, NULL);
int fd = ctl_connect("/run/" PACKAGE_NAME, dev);
if (fd == -1) {
perror("set");
return 1;
}
if (ctl_connect(fd, "/run/" PACKAGE_NAME, dev) == -1) {
perror("set");
ctl_delete(fd);
return 1;
}
int ret = 0;
if (argz_is_set(pathz, "mtu"))