Skip to contentSkip to conversation

loadpolicy: only close polFd if it is valid

PATCH Applied Ian Campbell 3 participants 4 messages Feb 10, 2016 – Feb 29, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 loadpolicy: only close polFd if it is valid

It can be -1 at this point.

CID 1055562

---
 tools/flask/utils/loadpolicy.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/flask/utils/loadpolicy.c +1 -1
index 47b5139..76710a2 100644
@@ -115,7 +115,7 @@ done:
         if ( ret < 0 )
             fprintf(stderr, "Unable to unmap policy memory: %s\n", strerror(errno));
     }
-    if ( polFd )
+    if ( polFd >= 0 )
         close(polFd);
     if ( xch )
         xc_interface_close(xch);
Signature · 1 line
2.1.4
Acked-by on v1 1/1
#1 lore raw
Quoted 4 lines · Ian Campbell

It can be -1 at this point.

CID 1055562

Quoted 20 lines
---
 tools/flask/utils/loadpolicy.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/flask/utils/loadpolicy.c +1 -1
index 47b5139..76710a2 100644
@@ -115,7 +115,7 @@ done:
         if ( ret < 0 )
             fprintf(stderr, "Unable to unmap policy memory: %s\n", strerror(errno));
     }
-    if ( polFd )
+    if ( polFd >= 0 )
         close(polFd);
     if ( xch )
         xc_interface_close(xch);
Signature · 1 line
2.1.4
#3 lore raw
Quoted 10 lines · Ian Campbell
Quoted 7 lines · Wei Liu
Quoted 4 lines · Ian Campbell

It can be -1 at this point.

CID 1055562

Ian, will you commit this one?

Applied.

Quoted 6 lines

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel