From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 127265 invoked by alias); 29 Dec 2015 16:43:47 -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 127254 invoked by uid 89); 29 Dec 2015 16:43:46 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=AWL,BAYES_40,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=0291, 2015-12-25, 1204, inode X-HELO: lb3-smtp-cloud6.xs4all.net Received: from lb3-smtp-cloud6.xs4all.net (HELO lb3-smtp-cloud6.xs4all.net) (194.109.24.31) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Tue, 29 Dec 2015 16:43:44 +0000 Received: from webmail.xs4all.nl ([194.109.20.203]) by smtp-cloud6.xs4all.net with ESMTP id zUjh1r00L4NtgTm01UjhqH; Tue, 29 Dec 2015 17:43:41 +0100 Received: from a83-162-234-136.adsl.xs4all.nl ([83.162.234.136]) by webmail.xs4all.nl with HTTP (HTTP/1.1 POST); Tue, 29 Dec 2015 17:43:41 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Date: Tue, 29 Dec 2015 16:43:00 -0000 From: Houder To: cygwin@cygwin.com Subject: Re: cmp (or echo) bug? In-Reply-To: References: Message-ID: <2fd8829b7e5d7d1904306d45fbb63a7d@xs4all.nl> X-Sender: houder@xs4all.nl (Gv8nUPbHDppJ/4axoqLXUQ==) User-Agent: XS4ALL Webmail X-IsSubscribed: yes X-SW-Source: 2015-12/txt/msg00348.txt.bz2 On 2015-12-25 22:32, David Balažic wrote: > Hi! > > In Cygwin terminal (bash) I typed: > > cmp <(echo echo1) <(echo echo2) > > This does not print anything. > Not even with -b. > > On Linux (Ubuntu 12.04 in VMWare) it reports that the inputs are > different. > > Bug? > Or am I missing something? @@ uname -a CYGWIN_NT-6.1-WOW Seven 2.3.1(0.291/5/3) 2015-11-14 12:42 i686 Cygwin @@ ./cmp <(echo echo1) <(echo echo2) /dev/fd/63 /dev/fd/62 differ: byte 5, line 1 @@ ./cmp <(echo echo1) <(echo echo2) /dev/fd/63 /dev/fd/62 differ: byte 5, line 1 @@ ./cmp <(echo echo1) <(echo echo2) /dev/fd/63 /dev/fd/62 differ: byte 5, line 1 @@ ./cmp <(echo echo1) <(echo echo2) /dev/fd/63 /dev/fd/62 differ: byte 5, line 1 @@ ./cmp <(echo echo1) <(echo echo2) /dev/fd/63 /dev/fd/62 differ: byte 5, line 1 @@ ./cmp <(echo echo1) <(echo echo2) /dev/fd/63 /dev/fd/62 differ: byte 5, line 1 etc. But only after I had modified cmp.c (diffutils) as follows: int main (int argc, char **argv) { ... #if 0 if (file_desc[f1] < 0 || fstat (file_desc[f1], stat_buf + f1) != 0) #else if (file_desc[f1] < 0 || f1 ? ( stat (file[1], stat_buf + f1) != 0 ) : ( stat (file[0], stat_buf + f1) != 0 ) ) // Henri: suspect fstat #endif { if (file_desc[f1] < 0 && comparison_type == type_status) exit (EXIT_TROUBLE); else error (EXIT_TROUBLE, errno, "%s", file[f1]); } } /* If the files are links to the same inode and have the same file position, they are identical. */ if (0 < same_file (&stat_buf[0], &stat_buf[1]) && same_file_attributes (&stat_buf[0], &stat_buf[1]) && file_position (0) == file_position (1)) { // Henri: diagnostics #if 0 printf("same_file = %d\n", same_file (&stat_buf[0], &stat_buf[1]) ); printf("same_file_attributes = %d\n", same_file_attributes (&stat_buf[0], &stat_buf[1]) ); printf("same file pos = %d\n", file_position (0) == file_position (1) ); #endif printf("file[0] = %s, file[1] = %s\n", file[0], file[1]); printf("file_desc[0] = %d, file_desc[1] = %d\n", file_desc[0], file_desc[1]); printf("bailing out: same file.\n"); return EXIT_SUCCESS; } Regards, Henri -- 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