Improve error messages

Signed-off-by: Adrien Gallouët <adrien@gallouet.fr>
This commit is contained in:
Adrien Gallouët
2019-06-27 14:17:58 +00:00
parent 4a68866201
commit 170b3df0af

View File

@@ -72,7 +72,7 @@ gt_setup_secretkey(struct mud *mud, const char *keyfile)
close(fd); close(fd);
if (size != sizeof(buf)) { if (size != sizeof(buf)) {
gt_log("unable to read secret key\n"); gt_log("couldn't read secret key\n");
return -1; return -1;
} }
@@ -95,7 +95,7 @@ gt_setup_mtu(struct mud *mud, size_t old, const char *tun_name)
return mtu; return mtu;
if (iface_set_mtu(tun_name, mtu) == -1) if (iface_set_mtu(tun_name, mtu) == -1)
perror("tun_set_mtu"); gt_log("couldn't setup MTU at %zu on device %s\n", mtu, tun_name);
return mtu; return mtu;
} }
@@ -174,7 +174,7 @@ gt_bind(int argc, char **argv)
size_t mtu = gt_setup_mtu(mud, 0, tun_name); size_t mtu = gt_setup_mtu(mud, 0, tun_name);
if (tun_set_persist(tun_fd, persist) == -1) { if (tun_set_persist(tun_fd, persist) == -1) {
gt_log("unable to %sable persist mode on device %s\n", gt_log("couldn't %sable persist mode on device %s\n",
persist ? "en" : "dis", tun_name); persist ? "en" : "dis", tun_name);
} }