mdev: treat zero-length /dev/mdev.seq the same as "\n" one. Closes 7334

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko 2014-09-08 18:19:15 +02:00
parent 07f7ea70ed
commit 26a8b9f196

View File

@ -972,7 +972,7 @@ wait_for_seqfile(const char *seq)
break; break;
} }
seqbuf[seqlen] = '\0'; seqbuf[seqlen] = '\0';
if (seqbuf[0] == '\n') { if (seqbuf[0] == '\n' || seqbuf[0] == '\0') {
/* seed file: write out seq ASAP */ /* seed file: write out seq ASAP */
xwrite_str(seq_fd, seq); xwrite_str(seq_fd, seq);
xlseek(seq_fd, 0, SEEK_SET); xlseek(seq_fd, 0, SEEK_SET);