| Summary: | diff fifo1 fifo2 always returns 0 | ||
|---|---|---|---|
| Product: | Busybox | Reporter: | michael fox <415fox> |
| Component: | Other | Assignee: | unassigned |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | busybox-cvs |
| Priority: | P5 | ||
| Version: | 1.23.x | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Linux | ||
| Host: | Target: | ||
| Build: | |||
I wanted to work on this but some nice person me to it. :( Confirmed fixed in master branch. Here's some added tests if anyone wants them. diff --git a/testsuite/diff.tests b/testsuite/diff.tests index 6de4648..fdde7cd 100755 --- a/testsuite/diff.tests +++ b/testsuite/diff.tests @@ -214,4 +214,35 @@ SKIP= # clean up rm -rf diff1 diff2 +mkfifo fifo1 fifo2 +echo qwe >fifo1 & +echo rty >fifo2 & +testing "diff of two fifos" \ + "diff -u fifo1 fifo2 | $TRIM_TAB;" \ +"\ +--- fifo1 ++++ fifo2 +@@ -1 +1 @@ +-qwe ++rty +" \ + "" "" +SKIP= + +echo qwe >fifo1 & +testing "diff fifo and stdin" \ + "diff -u fifo1 - | $TRIM_TAB;" \ +"\ +--- fifo1 ++++ - +@@ -1 +1 @@ +-qwe ++rty +" \ + "" "rty\n" +SKIP= + +# clean up +rm -rf fifo1 fifo2 + exit $FAILCOUNT |
Switching to BusyBox diff: sh$ mkfifo fifo sh$ echo foo > fifo & sh$ echo bar | diff fifo - sh$ echo $? 0 Or: sh$ mkfifo fifo fifo2 sh$ echo foo > fifo & sh$ echo bar > fifo2 & sh$ diff fifo fifo2 sh$ echo $? 0 Thanks to xz-utils developer Lasse Collin for these examples.