Bug 437974 - adjtime() doesn't adjust time
adjtime() doesn't adjust time
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: glibc (Show other bugs)
rawhide
All Linux
low Severity low
: ---
: ---
Assigned To: Jakub Jelinek
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-03-18 10:42 EDT by Miroslav Lichvar
Modified: 2008-04-04 18:41 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-04-04 18:41:00 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Miroslav Lichvar 2008-03-18 10:42:33 EDT
Description of problem:
adjtime no longer adjusts time. It seems to be related to the new
ADJ_OFFSET_SS_READ support introduced in
http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/sysdeps/unix/sysv/linux/adjtime.c.diff?r1=1.12.2.1&r2=1.12.2.2&cvsroot=glibc

Perhaps the "tntx.modes = ADJ_OFFSET_SS_READ;" assignment should be in the else
branch of "if (itv)" ?

Version-Release number of selected component (if applicable):
glibc-2.7.90-9
kernel-2.6.25-0.121.rc5.git4.fc9

How reproducible:
Always

Steps to Reproduce:
1. gcc -x c - <<EOF
#include <sys/time.h>

int main() {
        struct timeval tv, otv;

        tv.tv_sec = 0;
        tv.tv_usec = 100;
        adjtime(&tv, &otv);
        return 0;
}
EOF
2. ./a.out
  
Actual results:
Time not adjusted.

Expected results:
Time adjusted.

Additional info:
This breaks ntpd in -x mode.
Comment 1 Ulrich Drepper 2008-03-24 12:12:02 EDT
(In reply to comment #0)
> Perhaps the "tntx.modes = ADJ_OFFSET_SS_READ;" assignment should be in the else
> branch of "if (itv)" ?

Indeed.  Fixed upstream.
Comment 2 Jakub Jelinek 2008-04-04 18:41:00 EDT
Should be in glibc-2.7.90-12 and above.

Note You need to log in before you can comment on or make changes to this bug.