[vlc-commits] Do not print start banner if stderr is not a TTY.

Rémi Denis-Courmont git at videolan.org
Sat Jul 16 11:53:45 CEST 2011


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Jul 16 11:51:18 2011 +0300| [62f348b047c0c691c4a47970072522a66633f486] | committer: Rémi Denis-Courmont

Do not print start banner if stderr is not a TTY.

The user is not going to see the banner, and this tends to clutter
error logs (X server, cron jobs...) - not only on MacOS.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=62f348b047c0c691c4a47970072522a66633f486
---

 bin/vlc.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/bin/vlc.c b/bin/vlc.c
index 75a97a1..ee30bd4 100644
--- a/bin/vlc.c
+++ b/bin/vlc.c
@@ -121,11 +121,11 @@ int main( int i_argc, const char *ppsz_argv[] )
 
     setlocale (LC_ALL, "");
 
-#ifndef __APPLE__
-    /* This clutters OSX GUI error logs */
-    fprintf( stderr, "VLC media player %s (revision %s)\n",
-             libvlc_get_version(), libvlc_get_changeset() );
-#endif
+    if (isatty (STDERR_FILENO))
+        /* This message clutters error logs. It is print it only on a TTY.
+         * Forunately, LibVLC prints version infos with -vv anyhow. */
+        fprintf (stderr, "VLC media player %s (revision %s)\n",
+                 libvlc_get_version(), libvlc_get_changeset());
 
     sigset_t set;
 



More information about the vlc-commits mailing list