From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 81950 invoked by alias); 4 Jul 2017 12:41:35 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 81937 invoked by uid 89); 4 Jul 2017 12:41:34 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.1 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM autolearn=no version=3.3.2 spammy=fans, comic, wsl, 04.07.2017 X-HELO: mout.kundenserver.de Received: from mout.kundenserver.de (HELO mout.kundenserver.de) (212.227.126.134) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 04 Jul 2017 12:41:32 +0000 Received: from [10.160.165.155] ([178.19.220.109]) by mrelayeu.kundenserver.de (mreue002 [212.227.15.167]) with ESMTPSA (Nemesis) id 0MXi7y-1dFqBy1oBC-00WVTa for ; Tue, 04 Jul 2017 14:41:28 +0200 Subject: Re: scandirat return dirents of parent dir To: cygwin@cygwin.com References: From: Thomas Wolff Message-ID: <21bf1880-5ed4-110c-d0bb-06ad47591be1@towo.net> Date: Tue, 04 Jul 2017 12:41:00 -0000 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-UI-Out-Filterresults: notjunk:1;V01:K0:RVowwdvOGaY=:oLfmT1rLNTjhrbUyfaUk7z U7KsKnNfsf3hZePzMMsjL3v5n99xUF1x9jN0UPOWFfI5JX9XXfujvBU21zbsDN2R265Qxjl3e X7WoAYff5lz4qFfY5xBxJi+KeB7NknXCrroB18QV69ubXM0ja+R17Wr88jPkl0pfXbWjdo0Q2 KbOXdIYys2++dzdQ+OhvxyTiAhUe3QSDkntagx/aSxorqLLiwcEn6ymNtyhkrsJFxVD4cvs4q jrrMCH0ZijoRJW2sTLTJCT7LHIBANJwhL1ACOOSY3J0C+6mdva96za6wRDRISXe7yUngFlhKd prOBjkkL9rRkCQFh0womP7B78xr2stutI8VULBlynFpCKyuvOV6aeeboKo0JI3vlKsdj5fCDq XzFXm2fCCdAewsuoOcQIOh0dPuoiL11Em84+EM5yAfmsrTFm3fwvD2BKoJ29QtowMdmZfaFu4 WfBceAWzl4BlFuiHyZYgJdOw6mLWqSA6urL5un2Pi2C721Yo2me7qQ0Dl6URNQr/q9JZElM6T fJ+yUFXY02Y40czczcJHaGMOMcyeDQ3h4WbvnSEU/RVEekxy1y+gQOMnuHNnYy3LcuHti9N55 ZPLIr+tUYy/oNXrrX54Ia0KUrOJ4jDucOnIU+sd4fQNRNPsfrmvbhiopVaMl/NKS+l2HyI5So QgVxKz0D7Vc6KzM/ORtL2aBOmbspHMJzbIAUDARu7qlNw+wiO7tX+HeA05M6xGRLaj2vdUQrk jA9uXnBPG9KwOCgO X-IsSubscribed: yes X-SW-Source: 2017-07/txt/msg00047.txt.bz2 On 04.07.2017 13:09, comic fans wrote: > Hello: > I've found this problem when compile > casync(https://github.com/systemd/casync.git) in cygwin,workflow to > trigger this : > rootfd=open(".",O_CLOEXEC|O_RDONLY|O_NOCTTY); > scandirat(rootfd,".", firstLevelDirEnts......); > foreach dirent in firstLevelDirEnts: > if dirent is dir: > subdirfd=openat(rootfd, > dirent->d_name,O_RDONLY|O_CLOEXEC|O_NOCTTY|O_NOFOLLOW); > scandirat(subdirfd,".", secondLevelDirEnts......); > > at this time, secondLevelDirEnts should be files in subdir, but > in cygwin, secondLevelDirEnts is just same as firstLevelDirEnts. > > This problem didn't happen in linux , nor win10 WSL, but > happens in both cygwin/msys2. It would be nice to provide a complete, compilable test case, please. It is unclear what you mean by "secondLevelDirEnts is just same" because that's different things inside a loop. Did you consider that one of the entries is ".."? -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple