/*
- * Copyright (C) 2014 Intel Corporation.
+ * Copyright (C) 2014-2015 Intel Corporation.
*/
#include <stdio.h>
#include <dlfcn.h>
#include <pthread.h>
#include <errno.h>
+#include <signal.h>
#include <hardware/sensors.h>
#include <utils/Log.h>
fprintf(f, "event: step_detector=%10.2f\n", e->data[0]);
break;
case SENSOR_TYPE_STEP_COUNTER:
- fprintf(f, "event: step_detector=%llu\n",
+ fprintf(f, "event: step_counter=%llu\n",
(unsigned long long)e->u64.step_counter);
break;
}
}
}
+static void sig_pipe(int sig)
+{
+ client = NULL;
+}
+
static void *run_sensors_thread(void *arg __attribute((unused)))
{
+
+ signal(SIGPIPE, sig_pipe);
+
switch (dev->version) {
case SENSORS_DEVICE_API_VERSION_0_1:
default:
fclose(f);
}
-
close(conn);
}
}
int main(int argc, char **argv)
{
- char cmd[1024], *tmp;
+ char cmd[1024];
int sock, i;
struct iovec buff = {
.iov_base = cmd,