[Devel] [PATCH][cr-test]: fileio1 - Keep logfile open

Sukadev Bhattiprolu sukadev at linux.vnet.ibm.com
Wed Jan 20 15:09:26 PST 2010


From: Sukadev Bhattiprolu <sukadev at linux.vnet.ibm.com>
Date: Wed, 20 Jan 2010 14:31:14 -0800
Subject: [PATCH]: fileio1 - Keep logfile open

In an attempt to close any as-yet uncheckpointable files that are open,
the test case closes all files. But in the process even the log file
(which is checkpointable) is also closed even though the test writes a
lot to the log subsequently.

Signed-off-by: Sukadev Bhattiprolu <sukadev at linux.vnet.ibm.com>
---
 fileio/fileio1.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/fileio/fileio1.c b/fileio/fileio1.c
index efd7c37..e9b468d 100644
--- a/fileio/fileio1.c
+++ b/fileio/fileio1.c
@@ -273,7 +273,10 @@ int main(int argc, char *argv[])
 	 * Cannot checkpoint process with open device files yet;
 	 */
 	printf("Closing stdio fds and writing messages to %s\n", log_fnam);
-	for (i=0; i<100; i++) close(i);
+	for (i=0; i<100; i++)  {
+		if (i != fileno(logfp))
+			close(i);
+	}
 
 	/*
 	 * Announce that we are now prepared for a checkpoint 
-- 
1.6.0.4

_______________________________________________
Containers mailing list
Containers at lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers




More information about the Devel mailing list