projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'collectd-5.5' into collectd-5.6
[collectd.git]
/
src
/
ted.c
diff --git
a/src/ted.c
b/src/ted.c
index
28ee8e4
..
5ed6c27
100644
(file)
--- a/
src/ted.c
+++ b/
src/ted.c
@@
-38,7
+38,6
@@
#include "common.h"
#include "plugin.h"
#include "common.h"
#include "plugin.h"
-#include "configfile.h"
#if HAVE_TERMIOS_H && HAVE_SYS_IOCTL_H && HAVE_MATH_H
# include <termios.h>
#if HAVE_TERMIOS_H && HAVE_SYS_IOCTL_H && HAVE_MATH_H
# include <termios.h>
@@
-108,7
+107,6
@@
static int ted_read_value(double *ret_power, double *ret_voltage)
while (end_flag == 0)
{
ssize_t receive_buffer_length;
while (end_flag == 0)
{
ssize_t receive_buffer_length;
- ssize_t i;
/* check for timeout or input error*/
status = select (fd + 1, &input, NULL, NULL, &timeout);
/* check for timeout or input error*/
status = select (fd + 1, &input, NULL, NULL, &timeout);
@@
-165,7
+163,7
@@
static int ted_read_value(double *ret_power, double *ret_voltage)
* the beginning of the package has been found. */
escape_flag = 0;
* the beginning of the package has been found. */
escape_flag = 0;
- for (i = 0; i < receive_buffer_length; i++)
+ for (
ssize_t
i = 0; i < receive_buffer_length; i++)
{
/* Check if previous byte was the escape byte. */
if (escape_flag == 1)
{
/* Check if previous byte was the escape byte. */
if (escape_flag == 1)
@@
-312,7
+310,6
@@
static int ted_read (void)
double power;
double voltage;
int status;
double power;
double voltage;
int status;
- int i;
status = ted_open_device ();
if (status != 0)
status = ted_open_device ();
if (status != 0)
@@
-320,7
+317,7
@@
static int ted_read (void)
power = NAN;
voltage = NAN;
power = NAN;
voltage = NAN;
- for (i = 0; i <= conf_retries; i++)
+ for (i
nt i
= 0; i <= conf_retries; i++)
{
status = ted_read_value (&power, &voltage);
if (status == 0)
{
status = ted_read_value (&power, &voltage);
if (status == 0)