mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-10-29 17:33:09 +00:00
Fri Feb 16 18:23:15 IST 2007 Mark McLoughlin <markmc@redhat.com>
* qemud/qemud.c: fix qemudEnableIpForwarding() to not leak an fd if writing to /proc/sys/net/ipv4/ip_forward fails.
This commit is contained in:
parent
1b350c101b
commit
80820ec7a9
@ -1,3 +1,8 @@
|
|||||||
|
Fri Feb 16 18:23:15 IST 2007 Mark McLoughlin <markmc@redhat.com>
|
||||||
|
|
||||||
|
* qemud/qemud.c: fix qemudEnableIpForwarding() to not leak
|
||||||
|
an fd if writing to /proc/sys/net/ipv4/ip_forward fails.
|
||||||
|
|
||||||
Fri Feb 16 11:56:24 EST 2007 Daniel P. Berrange <berrange@redhat.com>
|
Fri Feb 16 11:56:24 EST 2007 Daniel P. Berrange <berrange@redhat.com>
|
||||||
|
|
||||||
* tests/Makefile.am: Fixed linkage of test suites
|
* tests/Makefile.am: Fixed linkage of test suites
|
||||||
|
@ -980,12 +980,14 @@ qemudEnableIpForwarding(void)
|
|||||||
{
|
{
|
||||||
#define PROC_IP_FORWARD "/proc/sys/net/ipv4/ip_forward"
|
#define PROC_IP_FORWARD "/proc/sys/net/ipv4/ip_forward"
|
||||||
|
|
||||||
int fd;
|
int fd, ret;
|
||||||
|
|
||||||
if ((fd = open(PROC_IP_FORWARD, O_WRONLY|O_TRUNC)) == -1 ||
|
if ((fd = open(PROC_IP_FORWARD, O_WRONLY|O_TRUNC)) == -1)
|
||||||
write(fd, "1\n", 2) < 0)
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
if (write(fd, "1\n", 2) < 0)
|
||||||
|
ret = 0;
|
||||||
|
|
||||||
close (fd);
|
close (fd);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user