From: Sukadev Bhattiprolu <[email protected]> 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 <[email protected]> --- 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 [email protected] https://lists.linux-foundation.org/mailman/listinfo/containers _______________________________________________ Devel mailing list [email protected] https://openvz.org/mailman/listinfo/devel
