Package: xdiskusage Version: 1.48-7 Severity: important Tags: patch I attached the patch in bugreport #276193, I also send the patch as new bugreport to classify as a "Patch Available". Sorry if it bothers.
-- System Information: Debian Release: 4.0 APT prefers stable APT policy: (500, 'stable') Architecture: i386 (i686) Shell: /bin/sh linked to /bin/bash Kernel: Linux 2.6.22 Locale: [EMAIL PROTECTED], [EMAIL PROTECTED] (charmap=ISO-8859-15) (ignored: LC_ALL set to [EMAIL PROTECTED]) Versions of packages xdiskusage depends on: ii libc6 2.3.6.ds1-13 GNU C Library: Shared libraries ii libfltk1.1 1.1.7-3 Fast Light Toolkit shared librarie ii libgcc1 1:4.1.1-21 GCC support library ii libgl1-mesa-glx [libgl1] 6.5.1-0.6 A free implementation of the OpenG ii libglu1-mesa [libglu1] 6.5.1-0.6 The OpenGL utility library (GLU) ii libstdc++6 4.1.1-21 The GNU Standard C++ Library v3 ii libx11-6 2:1.0.3-7 X11 client-side library ii libxext6 1:1.0.1-2 X11 miscellaneous extension librar ii libxinerama1 1:1.0.1-4.1 X11 Xinerama extension library xdiskusage recommends no packages. -- no debconf information
--- xdiskusage-1.48/xdiskusage.C 2004-09-21 07:23:14.000000000 +0200 +++ xdiskusage-1.48.carles/xdiskusage.C 2007-07-30 23:42:05.000000000 +0200 @@ -223,6 +223,19 @@ return 1; } +// returns true if stdin is /dev/null +// To fix Debian bug #276193 +// Technically could be possible that returns "true" and is not "true", +// because same device ID is used across file systems. But is the best +// solutions that I have +int isstdinnull() { + struct stat ststdin,stnull; + stat("/dev/null",&stnull); + fstat(0,&ststdin); + + return (ststdin.st_rdev==stnull.st_rdev); +} + int main(int argc, char**argv) { #if FL_MAJOR_VERSION < 2 // Make fltk look more like KDE/Windoze: @@ -253,7 +266,7 @@ OutputWindow* d = OutputWindow::make(argv[n++]); if (d) d->show(argc,argv); } - } else if (!isatty(0)) { + } else if (!isatty(0) && !isstdinnull()) { // test for pipe, if so read stdin: OutputWindow* d = OutputWindow::make(0); if (d) d->show(argc,argv);