*/
#ifndef lint
-static char rcsid[] = "$Id: sys-osf.c,v 1.25 1999/04/12 06:24:50 paulus Exp $";
+static char rcsid[] = "$Id: sys-osf.c,v 1.27 1999/05/12 06:16:16 paulus Exp $";
#endif
#include <stdio.h>
if (i != fd && i != sockfd)
close(i);
closed_stdio = 1;
+ /* make sure 0, 1, 2 are open to /dev/null */
+ while ((i = open("/dev/null", O_RDWR)) >= 0) {
+ if (i > 2) {
+ close(i);
+ break;
+ }
+ }
}
/*
{
struct ifreq ifr;
+ bzero(&ifr, sizeof(ifr));
strlcpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name));
if (ioctl(sockfd, SIOCGIFFLAGS, &ifr) < 0) {
error("Couldn't mark interface down (get): %m");
ret = 0;
}
- ifr.ifr_metric = link_mtu;
+ ifr.ifr_data = (caddr_t)&link_mtu;
+
if (ioctl(sockfd, SIOCSIPMTU, &ifr) < 0) {
error("Couldn't set IP MTU: %m");
ret = 0;