Skip to contentSkip to conversation

ntp: fix return value of adjtimex() calling for STA_INS/DEL

PATCH New Seiichi Ikarashi 1 participant 1 message Nov 20, 2012 Timekeeping, clocksource core, NTP, alarmtimer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ntp: fix return value of adjtimex() calling for STA_INS/DEL

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.

kernel/time/ntp.c +4 -0
@@ -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;