Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 456e2f55 authored by Archana Sathyakumar's avatar Archana Sathyakumar
Browse files

rpm_log: Fix file_read error



Issue:
cat /d/rpm_log
sh: cat: /d/rpm_log: Try again

The change was incorrect pushed without braces around if statement.
Return -EAGAIN only if the file permission is O_NON_BLOCK or there
is nothing in the log buf.

Change-Id: Id7a549c223aad86185da928b2592c8de02e87623
Signed-off-by: default avatarArchana Sathyakumar <asathyak@codeaurora.org>
parent adaef641
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -225,9 +225,10 @@ static ssize_t msm_rpm_log_file_read(struct file *file, char __user *bufu,
						&(buf->read_idx));
	}

	if ((file->f_flags & O_NONBLOCK) && buf->len == 0)
	if ((file->f_flags & O_NONBLOCK) && buf->len == 0) {
		mutex_unlock(&buf->mutex);
		return -EAGAIN;
	}

	/* loop until new messages arrive */
	while (buf->len == 0) {