Date: Wed, 15 May 2002 13:31:03 -0600 From: Mike Makonnen <makonnen@pacbell.net> To: Giorgos Keramidas <keramida@FreeBSD.ORG> Cc: freebsd-audit@FreeBSD.ORG Subject: Re: RFC: Port of NetBSD cat(1)'s -f option. Message-ID: <1021491063.45509.645.camel@kokeb.ambesa.net> In-Reply-To: <20020515061827.GA47688@hades.hell.gr> References: <20020515061827.GA47688@hades.hell.gr>
next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 2002-05-15 at 00:18, Giorgos Keramidas wrote:
> Here's a patch that adds to our cat(1) the same functionality as
> NetBSD cat(1) when passed -f on the command line. The original
> commit log from NetBSD's CVS tree is:
[snip]
> @@ -138,7 +141,15 @@
> filename = "stdin";
> fd = STDIN_FILENO;
> } else {
> + struct stat st;
> +
> filename = path;
> + if (stat(path, &st) < 0 ||
> + S_ISREG(st.st_mode) == 0) {
> + i++; /* Skip to next file. */
> + continue;
> + }
> +
just a minor nit,
You might want to show a warning, since stat(2) can fail for any number
of reasons not related to the type of file.
Cheers,
Mike Makonnen
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-audit" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1021491063.45509.645.camel>
