From ed70a0cfa055fcd8c5243424ca8fb3e61ead2d8b Mon Sep 17 00:00:00 2001 From: tpearson Date: Mon, 19 Sep 2011 01:33:09 +0000 Subject: Copy tsak in from latest git Wait for tsak start before kdm init Set readonly access mode for SAK pipe in kdmtsak git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1254374 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kdmlib/kdmtsak.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'kdmlib') diff --git a/kdmlib/kdmtsak.cpp b/kdmlib/kdmtsak.cpp index ebfedb261..cb3c5b3b2 100644 --- a/kdmlib/kdmtsak.cpp +++ b/kdmlib/kdmtsak.cpp @@ -138,14 +138,14 @@ int main (int argc, char *argv[]) if (verifier_result == 0) { // OK, the calling process is authorized to retrieve SAK data // First, flush the buffer - mPipe_fd = open(FIFO_FILE, O_RDWR | O_NONBLOCK); + mPipe_fd = open(FIFO_FILE, O_RDONLY | O_NONBLOCK); numread = 1; while (numread > 0) { numread = read(mPipe_fd, readbuf, 6); } close(mPipe_fd); // Now wait for SAK press - mPipe_fd = open(FIFO_FILE, O_RDWR); + mPipe_fd = open(FIFO_FILE, O_RDONLY); while (mPipe_fd > -1) { numread = read(mPipe_fd, readbuf, 6); readbuf[numread] = 0; @@ -158,13 +158,13 @@ int main (int argc, char *argv[]) else { usleep(100); // Flush the buffer - mPipe_fd = open(FIFO_FILE, O_RDWR | O_NONBLOCK); + mPipe_fd = open(FIFO_FILE, O_RDONLY | O_NONBLOCK); numread = 1; while (numread > 0) { numread = read(mPipe_fd, readbuf, 6); } close(mPipe_fd); - mPipe_fd = open(FIFO_FILE, O_RDWR); + mPipe_fd = open(FIFO_FILE, O_RDONLY); } } else { -- cgit v1.2.1