Fix for hang in search_content()

Hello, Andrew!

You last patch for find.c does more than the ChangeLog says. This change
in search_content() is not described in ChangeLog.

-    while (1){
-       i = read (pipe, &c, 1);
-       if (i != 1)
-           break;
+    while ((i = read (pipe, &c, 1)) == 0){

If you think it's a formatting change, look again - it's not. Sometimes
(too often actually!) read() returns values other than 0 and 1, for
example -1.

If you want to rewrite this part in a clear, nice way you are welcome to,
but for now I'm reverting this part of your patch since it causes a
useless loop with 100% CPU load while attempting to search for contents.

Pavel Roskin

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]