mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-11-29 00:12:45 +00:00
Close all open file descriptors before restarting sysinstall.
PR: bin/30737 Submitted by: Alexey V. Neyman <alex.neyman@auriga.ru>
This commit is contained in:
parent
9b04180c2c
commit
55e3fefc53
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=84152
@ -273,6 +273,7 @@ deviceGetAll(void)
|
||||
if (ioctl(s, SIOCGIFCONF, (char *) &ifc) < 0)
|
||||
goto skipif; /* Jump over network iface probing */
|
||||
|
||||
close(s);
|
||||
ifflags = ifc.ifc_req->ifr_flags;
|
||||
end = (struct ifreq *) (ifc.ifc_buf + ifc.ifc_len);
|
||||
for (ifptr = ifc.ifc_req; ifptr < end; ifptr++) {
|
||||
@ -319,6 +320,7 @@ deviceGetAll(void)
|
||||
loopend:
|
||||
if (ifptr->ifr_addr.sa_len) /* I'm not sure why this is here - it's inherited */
|
||||
ifptr = (struct ifreq *)((caddr_t)ifptr + ifptr->ifr_addr.sa_len - sizeof(struct sockaddr));
|
||||
close(s);
|
||||
}
|
||||
|
||||
skipif:
|
||||
|
@ -56,8 +56,13 @@ intr_reboot(dialogMenuItem *self)
|
||||
static int
|
||||
intr_restart(dialogMenuItem *self)
|
||||
{
|
||||
int ret;
|
||||
int ret, fd, fdmax;
|
||||
|
||||
mediaClose();
|
||||
free_variables();
|
||||
fdmax = getdtablesize();
|
||||
for (fd = 3; fd < fdmax; fd++)
|
||||
close(fd);
|
||||
ret = execl(StartName, StartName, (char *)NULL);
|
||||
msgDebug("execl failed (%s)\n", strerror(errno));
|
||||
/* NOTREACHED */
|
||||
|
@ -273,6 +273,7 @@ deviceGetAll(void)
|
||||
if (ioctl(s, SIOCGIFCONF, (char *) &ifc) < 0)
|
||||
goto skipif; /* Jump over network iface probing */
|
||||
|
||||
close(s);
|
||||
ifflags = ifc.ifc_req->ifr_flags;
|
||||
end = (struct ifreq *) (ifc.ifc_buf + ifc.ifc_len);
|
||||
for (ifptr = ifc.ifc_req; ifptr < end; ifptr++) {
|
||||
@ -319,6 +320,7 @@ deviceGetAll(void)
|
||||
loopend:
|
||||
if (ifptr->ifr_addr.sa_len) /* I'm not sure why this is here - it's inherited */
|
||||
ifptr = (struct ifreq *)((caddr_t)ifptr + ifptr->ifr_addr.sa_len - sizeof(struct sockaddr));
|
||||
close(s);
|
||||
}
|
||||
|
||||
skipif:
|
||||
|
@ -56,8 +56,13 @@ intr_reboot(dialogMenuItem *self)
|
||||
static int
|
||||
intr_restart(dialogMenuItem *self)
|
||||
{
|
||||
int ret;
|
||||
int ret, fd, fdmax;
|
||||
|
||||
mediaClose();
|
||||
free_variables();
|
||||
fdmax = getdtablesize();
|
||||
for (fd = 3; fd < fdmax; fd++)
|
||||
close(fd);
|
||||
ret = execl(StartName, StartName, (char *)NULL);
|
||||
msgDebug("execl failed (%s)\n", strerror(errno));
|
||||
/* NOTREACHED */
|
||||
|
Loading…
Reference in New Issue
Block a user