From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2155) id 183CD3857C43; Thu, 1 Feb 2024 11:39:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 183CD3857C43 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1706787564; bh=81u22e2VlHa72HXDSwV9Av/1XvJ4FZOKZXRTm8HOJeg=; h=From:To:Subject:Date:From; b=AvIUFh620RcKDQ2lrQFvlnptwNz6mYa6bQXQ8FoCfuVqZu28Tm9xor4IM0GMHYHX2 zvdK2JXQ52DviaXYqoCHuQT+Ojz2bLWBkfKk/oUxDeKouATZ1sUyS5/9S3Tdi6pbbG DCMxZ1lZdK1hDQcqjccA5+7lfJPrYLnvzhw1xLvU= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Corinna Vinschen To: cygwin-cvs@sourceware.org Subject: [newlib-cygwin/main] Cygwin: devices.h: drop useless mode check X-Act-Checkin: newlib-cygwin X-Git-Author: Corinna Vinschen X-Git-Refname: refs/heads/main X-Git-Oldrev: 5353cb8ef8a5cf411ee3c3518edfd6f472abbe58 X-Git-Newrev: 219b2dff771d01d7be8e03adf068ac3b69a89363 Message-Id: <20240201113924.183CD3857C43@sourceware.org> Date: Thu, 1 Feb 2024 11:39:23 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3D219b2dff771= d01d7be8e03adf068ac3b69a89363 commit 219b2dff771d01d7be8e03adf068ac3b69a89363 Author: Corinna Vinschen AuthorDate: Tue Jan 23 20:06:33 2024 +0100 Commit: Corinna Vinschen CommitDate: Wed Jan 31 20:11:57 2024 +0100 Cygwin: devices.h: drop useless mode check =20 use IFTODT to generate type from mode. =20 Signed-off-by: Corinna Vinschen Diff: --- winsup/cygwin/local_includes/devices.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/winsup/cygwin/local_includes/devices.h b/winsup/cygwin/local_i= ncludes/devices.h index 1e035f9d6a3e..c4f06127418c 100644 --- a/winsup/cygwin/local_includes/devices.h +++ b/winsup/cygwin/local_includes/devices.h @@ -15,7 +15,6 @@ typedef unsigned short _minor_t; #define _minor(dev) ((dev) & ((1 << (sizeof (_minor_t) * 8)) - 1)) #define _major(dev) ((dev) >> (sizeof (_major_t) * 8)) =20 -#include #include #include "cygheap_malloc.h" =20 @@ -383,9 +382,7 @@ public: inline int exists () const {return exists_func (*this);} unsigned char type () const { - if (S_ISBLK (_mode)) - return DT_BLK; - return _mode >> 12; + return IFTODT (_mode); } };