|
From: Nicholas N. <nj...@ca...> - 2003-11-20 10:39:14
|
CVS commit by nethercote:
Printing usage message to stdout instead of stderr, which seems to be the
standard thing to do.
M +8 -5 vg_main.c 1.124
--- valgrind/coregrind/vg_main.c #1.123:1.124
@@ -536,7 +536,9 @@ Bool VG_(clo_demangle) = True;
Bool VG_(clo_trace_children) = False;
-/* See big comment in vg_include.h for meaning of these three. */
+/* See big comment in vg_include.h for meaning of these three.
+ fd is initially stdout, for --help, but gets moved to stderr by default
+ immediately afterwards. */
VgLogTo VG_(clo_log_to) = VgLogTo_Fd;
-Int VG_(clo_logfile_fd) = 2;
+Int VG_(clo_logfile_fd) = 1;
Char* VG_(clo_logfile_name) = NULL;
@@ -770,5 +772,6 @@ static void process_cmd_line_options ( v
# define ISSPACE(cc) ((cc) == ' ' || (cc) == '\t' || (cc) == '\n')
- eventually_logfile_fd = VG_(clo_logfile_fd);
+ /* log to stderr by default, but usage message goes to stdout */
+ eventually_logfile_fd = 2;
/* Once logging is started, we can safely send messages pertaining
@@ -1177,8 +1180,8 @@ static void process_cmd_line_options ( v
nature of it is. Oh the wonder of Unix streams. */
- /* So far we should be still attached to stderr, so we can show on
+ /* So far we should be still attached to stdout, so we can show on
the terminal any problems to do with processing command line
opts. */
- vg_assert(VG_(clo_logfile_fd) == 2 /* stderr */);
+ vg_assert(VG_(clo_logfile_fd) == 1 /* stdout */);
vg_assert(VG_(logging_to_filedes) == True);
|