All of lore.kernel.org
 help / color / mirror / Atom feed
From: Seiichi Ikarashi <s.ikarashi@jp.fujitsu.com>
To: John Stultz <johnstul@us.ibm.com>, John Stultz <john.stultz@linaro.org>
Cc: Thomas Gleixner <tglx@linutronix.de>, linux-kernel@vger.kernel.org
Subject: [PATCH] ntp: fix return value of adjtimex() calling for STA_INS/DEL
Date: Tue, 20 Nov 2012 17:21:06 +0900	[thread overview]
Message-ID: <50AB3D72.1050301@jp.fujitsu.com> (raw)

Hi,

Since commit 6b43ae8a619d17c4935c3320d2ef9e92bdeed05d,
adjtimex() system call returns TIME_OK even if STA_INS/DEL calling.
But the man page says it should be TIME_INS/TIME_DEL, respectively.

I have no idea except for such an ad-hoc fix.

Signed-off-by: Seiichi Ikarashi <s.ikarashi@jp.fujitsu.com>

--- a/kernel/time/ntp.c	2012-11-20 17:09:08.000000000 +0900
+++ b/kernel/time/ntp.c	2012-11-20 17:13:18.000000000 +0900
@@ -684,6 +684,10 @@ int do_adjtimex(struct timex *txc)
 	}
 
 	result = time_state;	/* mostly `TIME_OK' */
+	if (time_status & STA_INS)
+		result = TIME_INS;
+	else if (time_status & STA_DEL)
+		result = TIME_DEL;
 	/* check for errors */
 	if (is_error_status(time_status))
 		result = TIME_ERROR;

                 reply	other threads:[~2012-11-20  8:21 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50AB3D72.1050301@jp.fujitsu.com \
    --to=s.ikarashi@jp.fujitsu.com \
    --cc=john.stultz@linaro.org \
    --cc=johnstul@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.