ifdown: if socket can not be opened, then no need to close it
Subsystems (2)
PATCH 1/1 ifdown: if socket can not be opened, then no need to close it
Signed-off-by Pingfan Liu <[email protected]>
--- kexec/ifdown.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
kexec/ifdown.c +2 -1
@@ -34,7 +34,7 @@ int ifdown(void)if ((fd =socket (AF_INET ,SOCK_DGRAM ,0 )) <0 ) {fprintf (stderr,"ifdown: " );perror ("socket" ); - goto error; + goto exit; }if ((ifa =if_nameindex ()) ==NULL ) {
@@ -74,5 +74,6 @@ int ifdown(void) error:close (fd); +exit:return -1 ; }
Signature · 7 lines
2.7.4 _______________________________________________ kexec mailing list [email protected] http://lists.infradead.org/mailman/listinfo/kexec
Quoted 10 lines · Pingfan Liu
Signed-off-by Pingfan Liu <[email protected]>--- kexec/ifdown.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)kexec/ifdown.c +0
-0
kexec/ifdown.c int ifdown(void) · line 37
Quoted 5 lines
kexec/ifdown.c +1
-1@@ -34,7 +34,7 @@ int ifdown(void)if ((fd =socket (AF_INET ,SOCK_DGRAM ,0 )) <0 ) {fprintf (stderr,"ifdown: " );perror ("socket" ); - goto error; + goto exit;
may be 'return -1 ' from here itself..
anyway..both are fine.
kexec/ifdown.c int ifdown(void) · line 79
Quoted 11 lines
kexec/ifdown.c +1
-0}if ((ifa =if_nameindex ()) ==NULL ) {@@ -74,5 +74,6 @@ int ifdown(void) error:close (fd); +exit:return -1 ; }
Reviewed-by Pratyush Anand <[email protected]>
_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec