diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-09-19 01:33:09 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-09-19 01:33:09 +0000 |
commit | ed70a0cfa055fcd8c5243424ca8fb3e61ead2d8b (patch) | |
tree | 2f2cec87be00a108f68f9ae0c3ddd8ddee3e0a99 /kdmlib/kdmtsak.cpp | |
parent | f6ffb7a0c3339bae0567f70544efe5463d25d60c (diff) | |
download | tdebase-ed70a0cfa055fcd8c5243424ca8fb3e61ead2d8b.tar.gz tdebase-ed70a0cfa055fcd8c5243424ca8fb3e61ead2d8b.zip |
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
Diffstat (limited to 'kdmlib/kdmtsak.cpp')
-rw-r--r-- | kdmlib/kdmtsak.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
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 { |