chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
54453a9
)
ata_id: do not print empty serial numbers to avoid unwanted trailing '_'
author
Kay Sievers
<kay.sievers@vrfy.org>
Wed, 9 Feb 2011 11:49:19 +0000
(12:49 +0100)
committer
Kay Sievers
<kay.sievers@vrfy.org>
Wed, 9 Feb 2011 21:12:15 +0000
(22:12 +0100)
extras/ata_id/ata_id.c
patch
|
blob
|
history
diff --git
a/extras/ata_id/ata_id.c
b/extras/ata_id/ata_id.c
index 92387e50775632b38cd15732e62b416bb725a5c7..594cfb20172490af3994bd965273f488bab350cd 100644
(file)
--- a/
extras/ata_id/ata_id.c
+++ b/
extras/ata_id/ata_id.c
@@
-584,8
+584,12
@@
int main(int argc, char *argv[])
printf("ID_MODEL=%s\n", model);
printf("ID_MODEL_ENC=%s\n", model_enc);
printf("ID_REVISION=%s\n", revision);
printf("ID_MODEL=%s\n", model);
printf("ID_MODEL_ENC=%s\n", model_enc);
printf("ID_REVISION=%s\n", revision);
- printf("ID_SERIAL=%s_%s\n", model, serial);
- printf("ID_SERIAL_SHORT=%s\n", serial);
+ if (serial[0] != '\0') {
+ printf("ID_SERIAL=%s_%s\n", model, serial);
+ printf("ID_SERIAL_SHORT=%s\n", serial);
+ } else {
+ printf("ID_SERIAL=%s\n", model);
+ }
if (id.command_set_1 & (1<<5)) {
printf ("ID_ATA_WRITE_CACHE=1\n");
if (id.command_set_1 & (1<<5)) {
printf ("ID_ATA_WRITE_CACHE=1\n");