[PATCH] Check to see if stream is non-null before closing

# HG changeset patch # User Sharad Mishra <snmishra@us.ibm.com> # Date 1312828809 25200 # Node ID 8b4f6d69f40904ced24f7948f04f89e770e37bce # Parent dd060dd8dbbd6c1d9a73de4dffa9fb2ab84d62b9 Check to see if stream is non-null before closing. Added a check to see if the stream is non-null before calling close. Signed-off-by: Sharad Mishra <snmishra@us.ibm.com> diff -r dd060dd8dbbd -r 8b4f6d69f409 src/Virt_SwitchService.c --- a/src/Virt_SwitchService.c Thu Aug 04 11:22:32 2011 -0400 +++ b/src/Virt_SwitchService.c Mon Aug 08 11:40:09 2011 -0700 @@ -91,7 +91,8 @@ "No VSI Support found"); out: - pclose(stream); + if (stream != NULL) + pclose(stream); return s; }

On 08/10/2011 05:50 PM, Sharad Mishra wrote:
# HG changeset patch # User Sharad Mishra <snmishra@us.ibm.com> # Date 1312828809 25200 # Node ID 8b4f6d69f40904ced24f7948f04f89e770e37bce # Parent dd060dd8dbbd6c1d9a73de4dffa9fb2ab84d62b9 Check to see if stream is non-null before closing.
Added a check to see if the stream is non-null before calling close.
Signed-off-by: Sharad Mishra <snmishra@us.ibm.com>
diff -r dd060dd8dbbd -r 8b4f6d69f409 src/Virt_SwitchService.c --- a/src/Virt_SwitchService.c Thu Aug 04 11:22:32 2011 -0400 +++ b/src/Virt_SwitchService.c Mon Aug 08 11:40:09 2011 -0700 @@ -91,7 +91,8 @@ "No VSI Support found");
out: - pclose(stream); + if (stream != NULL) + pclose(stream); return s; }
+1 -- Eduardo de Barros Lima Software Engineer, Open Virtualization Linux Technology Center - IBM/Brazil eblima@br.ibm.com

+1 于 2011-8-11 4:50, Sharad Mishra 写道:
# HG changeset patch # User Sharad Mishra <snmishra@us.ibm.com> # Date 1312828809 25200 # Node ID 8b4f6d69f40904ced24f7948f04f89e770e37bce # Parent dd060dd8dbbd6c1d9a73de4dffa9fb2ab84d62b9 Check to see if stream is non-null before closing.
Added a check to see if the stream is non-null before calling close.
Signed-off-by: Sharad Mishra <snmishra@us.ibm.com>
diff -r dd060dd8dbbd -r 8b4f6d69f409 src/Virt_SwitchService.c --- a/src/Virt_SwitchService.c Thu Aug 04 11:22:32 2011 -0400 +++ b/src/Virt_SwitchService.c Mon Aug 08 11:40:09 2011 -0700 @@ -91,7 +91,8 @@ "No VSI Support found");
out: - pclose(stream); + if (stream != NULL) + pclose(stream); return s; }
_______________________________________________ Libvirt-cim mailing list Libvirt-cim@redhat.com https://www.redhat.com/mailman/listinfo/libvirt-cim
-- Best Regards Wayne Xia mail:xiawenc@linux.vnet.ibm.com tel:86-010-82450803
participants (3)
-
Eduardo Lima (Etrunko)
-
Sharad Mishra
-
Wayne Xia