File xs-22-reopen_log-fix.patch of Package xen.7673

commit d7ee5c3c7ad9a23441efc2a7553aa1df6996959d
Author: Juergen Gross <jgross@suse.com>
Date:   Wed Feb 22 16:28:45 2017 +0100

    xenstore: correct test for opened logfile in reopen_log()
    
    As 0 is a valid file descriptor testing a descriptor to be valid
    should be done via >= 0 instead of > 0.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Wei Liu <wei.liu2@citrix.com>

Index: xen-4.4.4-testing/tools/xenstore/xenstored_core.c
===================================================================
--- xen-4.4.4-testing.orig/tools/xenstore/xenstored_core.c
+++ xen-4.4.4-testing/tools/xenstore/xenstored_core.c
@@ -200,7 +200,7 @@ static void trigger_reopen_log(int signa
 static void reopen_log(void)
 {
 	if (tracefile) {
-		if (tracefd > 0)
+		if (tracefd >= 0)
 			close(tracefd);
 
 		tracefd = open(tracefile, O_WRONLY|O_CREAT|O_APPEND, 0600);
openSUSE Build Service is sponsored by