Module Name:    src
Committed By:   christos
Date:           Wed Oct 12 16:45:37 UTC 2011

Modified Files:
        src/sbin/raidctl: raidctl.c

Log Message:
PR/45456: Tetsuya Isaki: Don't mix stdio and write.


To generate a diff of this commit:
cvs rdiff -u -r1.54 -r1.55 src/sbin/raidctl/raidctl.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sbin/raidctl/raidctl.c
diff -u src/sbin/raidctl/raidctl.c:1.54 src/sbin/raidctl/raidctl.c:1.55
--- src/sbin/raidctl/raidctl.c:1.54	Wed Sep 28 06:29:41 2011
+++ src/sbin/raidctl/raidctl.c	Wed Oct 12 12:45:37 2011
@@ -1,4 +1,4 @@
-/*      $NetBSD: raidctl.c,v 1.54 2011/09/28 10:29:41 mrg Exp $   */
+/*      $NetBSD: raidctl.c,v 1.55 2011/10/12 16:45:37 christos Exp $   */
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -39,7 +39,7 @@
 #include <sys/cdefs.h>
 
 #ifndef lint
-__RCSID("$NetBSD: raidctl.c,v 1.54 2011/09/28 10:29:41 mrg Exp $");
+__RCSID("$NetBSD: raidctl.c,v 1.55 2011/10/12 16:45:37 christos Exp $");
 #endif
 
 
@@ -988,7 +988,6 @@ do_meter(int fd, u_long option)
 	double rate;
 	RF_uint64 amount;
 	int tbit_value;
-	char buffer[1024];
 	char bar_buffer[1024];
 	char eta_buffer[1024];
 
@@ -1049,10 +1048,8 @@ do_meter(int fd, u_long option)
 
 		get_time_string(eta_buffer, simple_eta);
 
-		snprintf(buffer,1024,"\r%3d%% |%s| ETA: %s %c",
-			 percent_done,bar_buffer,eta_buffer,tbits[tbit_value]);
-
-		write(fileno(stdout),buffer,strlen(buffer));
+		fprintf(stdout,"\r%3d%% |%s| ETA: %s %c",
+			percent_done,bar_buffer,eta_buffer,tbits[tbit_value]);
 		fflush(stdout);
 
 		if (++tbit_value>3) 

Reply via email to