[Ocfs2-tools-commits] smushran commits r272 - trunk/debugfs.ocfs2

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Tue Sep 28 18:39:12 CDT 2004


Author: smushran
Date: 2004-09-28 18:39:10 -0500 (Tue, 28 Sep 2004)
New Revision: 272

Modified:
   trunk/debugfs.ocfs2/commands.c
Log:
cat output now paged

Modified: trunk/debugfs.ocfs2/commands.c
===================================================================
--- trunk/debugfs.ocfs2/commands.c	2004-09-28 21:29:29 UTC (rev 271)
+++ trunk/debugfs.ocfs2/commands.c	2004-09-28 23:39:10 UTC (rev 272)
@@ -616,6 +616,7 @@
 {
 	__u64 blknum = 0;
 	__s32 outfd = -1;
+	FILE *out = NULL;
 	int flags;
 	int op = 0;  /* 0 = dump, 1 = cat */
 	char *outfile = NULL;
@@ -626,7 +627,8 @@
 	}
 
 	if (!strncasecmp (args[0], "cat", 3)) {
-		outfd = 1;
+		out = open_pager ();
+		outfd = fileno(out);
 		op = 1;
 	}
 
@@ -649,6 +651,11 @@
 	read_file (gbls.dev_fd, blknum, outfd, NULL);
 
 bail:
+	if (out) {
+		close_pager (out);
+		outfd = -1;
+	}
+	
 	if (outfd > 2)
 		close (outfd);
 



More information about the Ocfs2-tools-commits mailing list