Fix indent and device name on bsd

This commit is contained in:
Erik Ekman 2006-06-25 11:15:18 +00:00
parent c46c2c99ff
commit c7191d27e7

7
tun.c
View File

@ -100,8 +100,11 @@ open_tun(const char *tun_device)
char tun_name[50];
if (tun_device != NULL) {
if ((tun_fd = open(tun_device, O_RDWR)) < 0) {
warn("open_tun: %s: %s", tun_device, strerror(errno));
snprintf(tun_name, sizeof(tun_name), "/dev/%s", tun_device);
strncpy(if_name, tun_device, sizeof(if_name));
if ((tun_fd = open(tun_name, O_RDWR)) < 0) {
warn("open_tun: %s: %s", tun_name, strerror(errno));
return -1;
}
} else {