Hi,

My editor broke the indentation style in the patch; I'm resending it as
an attached file.

Thanks,

Daniel

On Sun, Apr 17, 2005 at 05:42:40PM +0200, Steinar H. Gunderson wrote:
> Hi,
> 
> Thanks for the patch; sending upstream for evaluation.
> 
> /* Steinar */
--- autofs-4.1.4.orig/modules/mount_nfs.c       2005-04-05 09:42:42.000000000 
-0300
+++ autofs-4.1.4/modules/mount_nfs.c    2005-04-16 22:59:05.000000000 -0300
@@ -251,33 +251,28 @@ int get_best_mount(char *what, const cha
 
        debug(MODPREFIX "winner = %s local = %d", winner, local);
 
-       /*
-        * We didn't find a weighted winner or local
-        */
-       if (!local && winner_weight == INT_MAX) {
-               /* We had more than one contender and none responded in time */
-               if (winner_time != 0 && winner_time > 500) {
-                       /* We've already tried a longer timeout */
-                       if (!longtimeout) {
-                               /* Reset string and try again */
-                               strcpy(what, original);
-
-                               debug(MODPREFIX 
-                                     "all hosts timed out for '%s', "
-                                     "retrying with longer timeout",
-                                     original);
-
-                               return get_best_mount(what, original, 1, 1);
-                       }
+       /* No winner found */
+       if (!local && !winner) {
+               
+               /* Retry with a longer timeout */
+               if (!longtimeout) {
+                       /* Reset string and try again */
+                       strcpy(what, original);
+           
+                       debug(MODPREFIX 
+                             "all hosts timed out for '%s', "
+                             "retrying with longer timeout",
+                             original);
+                       
+                       return get_best_mount(what, original, 1, 1);
+               }
+               else {
+                       /* No hosts responded, winner = first host */
+                       winner = what;
                }
+               
        }
-
-       /* No winner found so bail */
-       if (!winner) {
-               *what = '\0';
-               return 0;
-       }
-
+       
        /*
         * We now have our winner, copy it to the front of the string,
         * followed by the next :string<delim>

Reply via email to