X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:subject:to:references:from:message-id:date :mime-version:in-reply-to:content-type :content-transfer-encoding; q=dns; s=default; b=BUPBonnsq/npOgwB /50+cF2YrXQ1QhP3mF2O+3ksgG4lkWTtVSnQ9MYX2rQlYBu4BhDqKIidHHGjZeg0 ZnSx713O+aMPBXAJwPuTijkXFwPVzGFKdDY5dCYWGM9AWqFgDLfs/hqFC0PueBDJ XpyOx6GVMeThKf7J9fo8O5kWnSs= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:subject:to:references:from:message-id:date :mime-version:in-reply-to:content-type :content-transfer-encoding; s=default; bh=gKQQUcKMv97kjT7+jIfDn5 BY6JE=; b=scrzDGEWumJng+EThEnYftx8UzpIm8483v6lcdWlF2Wn2SFKx7OXvg ar2kmbuL0MQ/8pWuyHO/VjX3W5mcXsrvZM+lPQK3WCRwU0FlpWgCw8PIzY8ae8iE V9hdNaKk/0WbJDC2+FLrN3K9/uvkI0ATLtzXRx3W+7J044EHp8I/4= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com 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 Subject: Re: scandirat return dirents of parent dir To: cygwin AT cygwin DOT com References: From: Thomas Wolff Message-ID: <21bf1880-5ed4-110c-d0bb-06ad47591be1@towo.net> Date: Tue, 4 Jul 2017 14:41:27 +0200 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 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