projects
/
psensor.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
d2fde10
)
normalize and cleanup
author
Jean-Philippe Orsini
<jeanfi@gmail.com>
Fri, 19 Sep 2014 07:23:21 +0000
(09:23 +0200)
committer
Jean-Philippe Orsini
<jeanfi@gmail.com>
Fri, 19 Sep 2014 07:23:21 +0000
(09:23 +0200)
src/lib/hdd_atasmart.c
patch
|
blob
|
history
diff --git
a/src/lib/hdd_atasmart.c
b/src/lib/hdd_atasmart.c
index
b34564e
..
7920d93
100644
(file)
--- a/
src/lib/hdd_atasmart.c
+++ b/
src/lib/hdd_atasmart.c
@@
-39,6
+39,8
@@
#include <hdd.h>
#include <plog.h>
#include <hdd.h>
#include <plog.h>
+static const char *PROVIDER_NAME = "atasmart";
+
static int filter_sd(const char *p)
{
return strlen(p) == 8 && !strncmp(p, "/dev/sd", 7);
static int filter_sd(const char *p)
{
return strlen(p) == 8 && !strncmp(p, "/dev/sd", 7);
@@
-133,9
+135,11
@@
struct psensor **hdd_psensor_list_add(struct psensor **sensors,
log_debug("hdd_psensor_list_add(hdd_atasmart) open %s", *tmp);
if (!sk_disk_open(*tmp, &disk)) {
log_debug("hdd_psensor_list_add(hdd_atasmart) open %s", *tmp);
if (!sk_disk_open(*tmp, &disk)) {
- id = malloc(strlen("atasmart ") + strlen(*tmp) + 1);
- strcpy(id, "atasmart ");
- strcat(id, *tmp);
+ id = malloc(strlen(PROVIDER_NAME)
+ + 1
+ + strlen(*tmp)
+ + 1);
+ sprintf(id, "%s %s", PROVIDER_NAME, *tmp);
sensor = create_sensor(id,
*tmp,
sensor = create_sensor(id,
*tmp,