Re: File System Performance

Mike Castle
2001-11-12T23:04:48Z

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?

mrc
--
Mike Castle dalgoda@ix.netcom.com www.netcom.com/~dalgoda/
We are all of us living in the shadow of Manhattan. -- Watchmen
fatal ("You are in a maze of twisty compiler features, all different"); -- gcc