summaryrefslogtreecommitdiffstats
path: root/kdmlib
diff options
context:
space:
mode:
Diffstat (limited to 'kdmlib')
-rw-r--r--kdmlib/kdmtsak.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/kdmlib/kdmtsak.cpp b/kdmlib/kdmtsak.cpp
index e1ed9ddc9..967e54855 100644
--- a/kdmlib/kdmtsak.cpp
+++ b/kdmlib/kdmtsak.cpp
@@ -40,18 +40,19 @@ int main (int argc, char *argv[])
}
// Now wait for SAK press
mPipe_fd = open(FIFO_FILE, O_RDONLY);
- if (mPipe_fd > -1) {
+ while (mPipe_fd > -1) {
numread = read(mPipe_fd, readbuf, 6);
readbuf[numread] = 0;
readbuf[127] = 0;
- close(mPipe_fd);
if (strcmp(readbuf, "SAK\n\r") == 0) {
+ close(mPipe_fd);
return 0;
}
else {
- return 1;
+ usleep(100);
}
}
+ close(mPipe_fd);
return 6;
}
else {