lkml.org 
[lkml]   [2001]   [Nov]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: File System Performance
    Mike Castle wrote:
    >
    > On Mon, Nov 12, 2001 at 02:36:08PM -0800, Andrew Morton wrote:
    > > /* Detect if outputting to "/dev/null". */
    > > {
    > > static char const dev_null[] = "/dev/null";
    > > struct stat dev_null_stat;
    > >
    > > dev_null_output =
    > > (strcmp (archive_name_array[0], dev_null) == 0
    > > || (! _isrmt (archive)
    > > && stat (dev_null, &dev_null_stat) == 0
    > > && S_ISCHR (archive_stat.st_mode)
    > > && archive_stat.st_rdev == dev_null_stat.st_rdev));
    > > }
    > >
    > > It's actually a bug. I may _want_ an ISREG /dev/null...
    >
    > Doesn't the S_ISCHR() handle that case?
    >

    No. It is: if (A || B)
    If A is true, B is not even evaluated.
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2005-03-22 13:13    [W:4.176 / U:0.008 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site