chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
add "Persistent Device Naming" rules file for disks
[elogind.git]
/
extras
/
ata_id
/
ata_id.c
diff --git
a/extras/ata_id/ata_id.c
b/extras/ata_id/ata_id.c
index 2840e914579c4118a0d6941ec91bd1c8522bae9a..ba40555a0b1040c3b41209ea8be484b81569a9b8 100644
(file)
--- a/
extras/ata_id/ata_id.c
+++ b/
extras/ata_id/ata_id.c
@@
-68,7
+68,7
@@
static void set_str(char *to, const char *from, size_t count)
/* strip trailing whitespace */
len = strnlen(from, count);
/* strip trailing whitespace */
len = strnlen(from, count);
- while (isspace(from[len-1]))
+ while (
len &&
isspace(from[len-1]))
len--;
/* strip leading whitespace */
len--;
/* strip leading whitespace */
@@
-122,10
+122,7
@@
int main(int argc, char *argv[])
goto exit;
}
goto exit;
}
- fd = open(node, O_RDONLY);
- if (fd < 0)
- if (errno == ENOMEDIUM)
- fd = open(node, O_RDONLY|O_NONBLOCK);
+ fd = open(node, O_RDONLY|O_NONBLOCK);
if (fd < 0) {
err("unable to open '%s'", node);
rc = 1;
if (fd < 0) {
err("unable to open '%s'", node);
rc = 1;