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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Sukadev Bhattiprolu <sukadev@xxxxxxxxxxxxxxxxxx>
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@xxxxxxxxxxxxxxxxxx>
---
 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@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linux-foundation.org/mailman/listinfo/containers

[Index of Archives]     [Cgroups]     [Netdev]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux