version 1.142, 2015/11/12 20:33:52 |
version 1.143, 2015/11/13 18:13:13 |
|
|
argc -= optind; |
argc -= optind; |
argv += optind; |
argv += optind; |
|
|
if (rtableid >= 0) { |
if (rtableid >= 0) |
if (setrtable(rtableid) == -1) |
if (setrtable(rtableid) == -1) |
err(1, "setrtable"); |
err(1, "setrtable"); |
} |
|
if (family == AF_UNIX) { |
if (family == AF_UNIX) { |
if (pledge("stdio rpath wpath cpath tmppath unix", NULL) == -1) |
if (pledge("stdio rpath wpath cpath tmppath unix", NULL) == -1) |
err(1, "pledge"); |
err(1, "pledge"); |
} |
} else if (Fflag) { |
else if (Fflag) { |
|
if (pledge("stdio inet dns sendfd", NULL) == -1) |
if (pledge("stdio inet dns sendfd", NULL) == -1) |
err(1, "pledge"); |
err(1, "pledge"); |
} |
} else if (usetls) { |
else if (usetls) { |
|
if (pledge("stdio rpath inet dns", NULL) == -1) |
if (pledge("stdio rpath inet dns", NULL) == -1) |
err(1, "pledge"); |
err(1, "pledge"); |
} |
} else if (pledge("stdio inet dns", NULL) == -1) |
else if (pledge("stdio inet dns", NULL) == -1) |
|
err(1, "pledge"); |
err(1, "pledge"); |
|
|
/* Cruft to make sure options are clean, and used properly. */ |
/* Cruft to make sure options are clean, and used properly. */ |
|
|
|
|
if (timeout_connect(s, res0->ai_addr, res0->ai_addrlen) == 0) |
if (timeout_connect(s, res0->ai_addr, res0->ai_addrlen) == 0) |
break; |
break; |
else if (vflag) |
if (vflag) |
warn("connect to %s port %s (%s) failed", host, port, |
warn("connect to %s port %s (%s) failed", host, port, |
uflag ? "udp" : "tcp"); |
uflag ? "udp" : "tcp"); |
|
|