From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 938 invoked by alias); 3 Jan 2016 17:21:51 -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 922 invoked by uid 89); 3 Jan 2016 17:21:50 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.1 required=5.0 tests=AWL,BAYES_20,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=houderxs4allnl, sk:houder@, U*houder, houder@xs4all.nl X-HELO: mail-lf0-f45.google.com Received: from mail-lf0-f45.google.com (HELO mail-lf0-f45.google.com) (209.85.215.45) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Sun, 03 Jan 2016 17:21:48 +0000 Received: by mail-lf0-f45.google.com with SMTP id p203so266772853lfa.0 for ; Sun, 03 Jan 2016 09:21:48 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.25.21.208 with SMTP id 77mr19054672lfv.96.1451841704883; Sun, 03 Jan 2016 09:21:44 -0800 (PST) Received: by 10.112.148.66 with HTTP; Sun, 3 Jan 2016 09:21:44 -0800 (PST) In-Reply-To: <2fd8829b7e5d7d1904306d45fbb63a7d@xs4all.nl> References: <2fd8829b7e5d7d1904306d45fbb63a7d@xs4all.nl> Date: Sun, 03 Jan 2016 17:21:00 -0000 Message-ID: Subject: Re: cmp (or echo) bug? From: =?UTF-8?Q?David_Bala=C5=BEic?= To: cygwin@cygwin.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2016-01/txt/msg00010.txt.bz2 cat and diff work as expected: $ cat <(echo echo1) <(echo echo2) echo1 echo2 $ diff <(echo echo1) <(echo echo2) 1c1 < echo1 --- > echo2 So maybe the bug is really in cmp. Regards, David On 29 December 2015 at 17:43, Houder wrote: > On 2015-12-25 22:32, David Bala=C5=BEic 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) !=3D = 0) > #else > if (file_desc[f1] < 0 || f1 ? ( stat (file[1], stat_buf + f1) !=3D = 0 ) > : ( stat (file[0], stat_buf + f1) !=3D = 0 ) ) > // Henri: suspect fstat > #endif > { > if (file_desc[f1] < 0 && comparison_type =3D=3D 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) =3D=3D file_position (1)) > { // Henri: diagnostics > #if 0 > printf("same_file =3D %d\n", same_file (&stat_buf[0], &stat_buf[1]) ); > printf("same_file_attributes =3D %d\n", same_file_attributes > (&stat_buf[0], &stat_buf[1]) ); > printf("same file pos =3D %d\n", file_position (0) =3D=3D file_positi= on (1) ); > #endif > printf("file[0] =3D %s, file[1] =3D %s\n", file[0], file[1]); > printf("file_desc[0] =3D %d, file_desc[1] =3D %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 > -- 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