ntp: Fix ntpd_running return TRUE most of the time
authorYu A Wang <yu.a.wang@intel.com>
Mon, 25 Apr 2011 08:28:17 +0000 (04:28 -0400)
committerSamuel Ortiz <sameo@linux.intel.com>
Wed, 27 Apr 2011 08:33:42 +0000 (10:33 +0200)
uninitialized ret value will return TRUE most of the time. By adding
 bind success situation, ret will be assigned the correct value.

plugins/ntpd.c

index 3ee2ad8..7a762a8 100644 (file)
@@ -102,7 +102,8 @@ static connman_bool_t ntpd_running(void)
                        ret = TRUE;
                else
                        ret = FALSE;
-        }
+        } else
+               ret = FALSE;
 
        close(sock);