/*
- * Copyright (C) 2010-2013 jeanfi@gmail.com
+ * Copyright (C) 2010-2014 jeanfi@gmail.com
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA
*/
+#define _LARGEFILE_SOURCE 1
+#include "config.h"
+
#include <locale.h>
#include <libintl.h>
#define _(str) gettext(str)
#include <atasmart.h>
#include <linux/fs.h>
-#include "pio.h"
-#include "hdd.h"
-#include "log.h"
+#include <pio.h>
+#include <hdd.h>
+#include <plog.h>
+
+static const char *PROVIDER_NAME = "atasmart";
static int filter_sd(const char *p)
{
s = psensor_create(id,
strdup(name),
- strdup("HDD"),
+ strdup(_("Disk")),
t,
values_max_length);
log_debug("hdd_psensor_list_add(hdd_atasmart) open %s", *tmp);
if (!sk_disk_open(*tmp, &disk)) {
- id = malloc(strlen("hdd at") + strlen(*tmp) + 1);
- strcpy(id, "hdd at");
- strcat(id, *tmp);
+ id = malloc(strlen(PROVIDER_NAME)
+ + 1
+ + strlen(*tmp)
+ + 1);
+ sprintf(id, "%s %s", PROVIDER_NAME, *tmp);
sensor = create_sensor(id,
*tmp,
cur = sensors;
while (*cur) {
s = *cur;
- if (s->type & SENSOR_TYPE_ATASMART) {
+ if (!(s->type & SENSOR_TYPE_REMOTE)
+ && s->type & SENSOR_TYPE_ATASMART) {
ret = sk_disk_smart_read_data(s->disk);
if (!ret) {