From owner-cvs-all Tue Sep 25 12:33:24 2001 Delivered-To: cvs-all@freebsd.org Received: from earth.backplane.com (earth.backplane.com [208.161.114.65]) by hub.freebsd.org (Postfix) with ESMTP id 6208D37B8DA; Tue, 25 Sep 2001 12:33:20 -0700 (PDT) Received: (from dillon@localhost) by earth.backplane.com (8.11.6/8.11.2) id f8PJ9eJ03402; Tue, 25 Sep 2001 12:09:40 -0700 (PDT) (envelope-from dillon) Date: Tue, 25 Sep 2001 12:09:40 -0700 (PDT) From: Matt Dillon Message-Id: <200109251909.f8PJ9eJ03402@earth.backplane.com> To: Ruslan Ermilov Cc: cvs-committers@FreeBSD.ORG, cvs-all@FreeBSD.ORG Subject: Re: cvs commit: src/bin/cat cat.1 cat.c References: <200109150039.f8F0dFZ41705@freefall.freebsd.org> <20010925211639.C57333@sunbay.com> Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG : :How about testing with stat(2) that an argument is a socket :thus eliminating the need to open(2) sockets and connect(2) :to non-sockets? I don't see any particular reason why. An open() failure is as fast or faster then stat(). If it fails and we get the appropriate errno, we try a connect(). Either connect() is supported or it isn't. If it is a case of a missing file we don't try the connect() because we get a different errno. I see no particular need to stat the path, no ill effects will occur if the connect() fails. -Matt To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message