From 7566fd148b1906a672217b78d9ee7e015a74cda9 Mon Sep 17 00:00:00 2001 From: rwatson Date: Wed, 20 Mar 2002 02:34:01 +0000 Subject: Teach growfs's dbg_open() that a filename of "-" for output means to open "/dev/stdout". This doesn't actually affect growfs, but does affect ffsinfo, permitting ffsinfo to output to the shell's stdout rather than requiring it be dumped to a file or explicitly pointed at a special device. Reviewed by: peter --- sbin/growfs/debug.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'sbin') diff --git a/sbin/growfs/debug.c b/sbin/growfs/debug.c index c86ca54..d178a26 100644 --- a/sbin/growfs/debug.c +++ b/sbin/growfs/debug.c @@ -71,7 +71,10 @@ void dbg_open(const char *fn) { - dbg_log=fopen(fn, "a"); + if (strcmp(fn, "-") == 0) + dbg_log=fopen("/dev/stdout", "a"); + else + dbg_log=fopen(fn, "a"); return; } -- cgit v1.1