Your message dated Thu, 17 Dec 2015 18:46:22 +0000
with message-id <[email protected]>
and subject line Bug#724929: fixed in adjtimex 1.29-7
has caused the Debian Bug report #724929,
regarding adjtimex: Blocks the access to the hardware (cmos) clock
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
724929: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=724929
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: adjtimex
Version: 1.29-2.2
Severity: normal
Tags: patch

Dear Maintainer,

  while "adjtimex" runs, the command "hwclock --show" does not work.

  The command keeps the device "/dev/rtc" open the whole time.

  It does not need to be open while the command sleeps, which is most of
the time it is running.

  Necessary changes:
  a) Open the device inside the while loop (not in front of it)
  b) Close it before the program goes to sleep before the end of the
     while loop

  Other changes
  a) Fixed some code to eliminate warnings from the compiler
  b) Some cosmetic changes.

  Patch:

--- adjtimex.c.original 2010-04-17 00:06:34.000000000 +0000
+++ adjtimex.c  2013-09-28 21:16:04.000000000 +0000
@@ -178,14 +178,14 @@ static void usage(void);
 static inline void outb (short port, char val);
 static inline void outb (short port, char val);
 static inline unsigned char inb (short port);
-static void cmos_init ();
-static void cmos_init_directisa ();
+static void cmos_init (void);
+static void cmos_init_directisa (void);
 static inline int cmos_read_bcd (int addr);
 static void cmos_read_time (time_t *cmos_timep, double *sysp);
 static void busywait_uip_fall(struct timeval *timestamp);
 static void busywait_second_change(struct tm *cmos, struct timeval *timestamp);
 static void compare(void);
-static void failntpdate();
+static void failntpdate(char *);
 static void reset_time_status(void);
 static struct cmos_adj *get_cmos_adjustment(void);
 static void log_times(void);
@@ -571,7 +571,7 @@ inb (short port)
  * Failing that, select and initialize direct I/O ports mode.
  */
 static
-void cmos_init ()
+void cmos_init (void)
 {
 /*
  following explanation taken from hwclock sources:
@@ -630,7 +630,7 @@ void cmos_init ()
  * second and following times).
  */
 static
-void cmos_init_directisa ()
+void cmos_init_directisa (void)
 {
 #ifdef USE_INLINE_ASM_IO
   if (verbose)
@@ -680,7 +680,7 @@ cmos_read_bcd (int addr)
 static int timeout;    /* An alarm signal has occurred */
 
 static void
-alarm_handler (int const dummy) {
+alarm_handler (int const dummy __attribute__ ((unused)) ) {
   timeout = 1;
 }
 
@@ -726,7 +726,7 @@ cmos_read_time (time_t *cmos_timep, doub
   int noint_fallback = 1;      /* detect tick by 0 => uip, 1 => time change */
   int got_tick = 0;
   int got_time = 0;
-  int saveerr;
+/*  int saveerr; */
   int type_uie, count;
   double update_delay;
 
@@ -797,13 +797,13 @@ cmos_read_time (time_t *cmos_timep, doub
                    }
                }
                rc = read(cmos_fd, &interrupt_info, sizeof(interrupt_info));
-               saveerr = errno;
+/*             saveerr = errno; */
                gettimeofday(&now, NULL);
 
                if (rc == -1)
                  {
                    /* no timeout, but read(/dev/rtc) failed for another reason 
*/
-                   char message[128];
+                   char message[BUFLEN];
                    snprintf(message, sizeof(message),
                             "adjtimex: "
                             "read() from %s to wait for clock tick failed",
@@ -874,7 +874,7 @@ cmos_read_time (time_t *cmos_timep, doub
             Or: UIE interrupts do beat, but RTC is invalid. */
          if (rc == -1)
            {
-             char message[128];
+             char message[BUFLEN];
              snprintf(message, sizeof(message),
                        "adjtimex: "
                        "ioctl(%s, RTC_RD_TIME) to read the CMOS clock failed",
@@ -1072,7 +1072,7 @@ busywait_second_change(struct tm *cmos,
      that the RTC isn't running or contains invalid data */
   if (rc == -1)
     {
-      char message[128];
+      char message[BUFLEN];
       snprintf(message, sizeof(message),
                "adjtimex: "
                "ioctl(%s, RTC_RD_TIME) to read the CMOS clock failed",
@@ -1165,10 +1165,10 @@ cmos clock last adjusted at Tue Aug 26 1
   }
 #endif
 
-  cmos_init ();
-
   while (count != 0)
     {
+      cmos_init ();
+
       if (count > 0) count--;
 
       cmos_read_time (&cmos_time, &system_sec);
@@ -1244,6 +1244,8 @@ cmos time     system-cmos  error_ppm   t
       printf ("%10ld  %13.6f",
              (long) cmos_sec,
              dif);
+      if (loops == 0)
+       printf ("%11s %6ld %9ld", " ", txc.tick, txc.freq);
       if (++loops > 1)
        {                       /* print difference in rates */
 #define SHIFT (1<<16)
@@ -1264,7 +1266,7 @@ cmos time     system-cmos  error_ppm   t
                     txc.tick + tick_delta, txc.freq + freq_delta);
              if (loops > 4 && adjusting)
                {
-                 if (abs(error_ppm)>10000)
+                 if (abs(error_ppm) > 10000)
                    {
                      if (!force_adjust)
                        {
@@ -1298,6 +1300,10 @@ cmos time     system-cmos  error_ppm   t
       dif_prev = dif;
       if (interval == 0)
        break;
+/* Release read access to cmos clock (/dev/rtc) while sleeping */
+/* Otherwise others can't access the clock ("hwclock --show" does not work) */
+      close(cmos_fd);
+      using_dev_rtc = -1;
       if (count)               /* if it is not the last round */
        xusleep (interval*1000000L - 500000); /* reading RTC takes 1 sec */
     }
@@ -1335,8 +1341,8 @@ static void log_times()
   struct hostent he;
 #endif
   double sigma_ref;
-  char ch, buf[64], *s;
-  int n, ret;
+  char ch __attribute__ ((unused)), buf[64], *s;
+  int n, ret __attribute__ ((unused));
   struct timeval tv_sys;
   struct tm bdt;
   time_t when, tref;
@@ -1397,9 +1403,10 @@ static void log_times()
   else if (timeserver)
     {
       FILE *ifile;
-      char command[128];
+      char command[BUFLEN];
       char buf[BUFLEN];
-      int i, j;
+      unsigned int i;
+      int j;
       double d, mean=0, val, var=0, num=0; /* for finding statistics */
       
       struct stat filestat;
@@ -2154,7 +2161,7 @@ void review()
       error_ppm += tick_delta*hz;
       printf("      suggested tick = %5ld  freq = %9.0f\n",
             tick_mid + tick_delta, -error_ppm*SHIFT);
-      if (abs(error_ppm)>500)
+      if (abs(error_ppm) > 500)
        printf ("WARNING: required correction is greater "
                "than plus/minus 500 parts per million.\n");
     }
@@ -2171,7 +2178,7 @@ void review()
 "least squares solution has a bigger error than estimated here\n");
   if (sigma_ppm < 100 && adjusting)
     {
-      if (abs(error_ppm)>500)
+      if (abs(error_ppm) > 500)
        {
          if (force_adjust)
            printf (


-- System Information:
Debian Release: 7.1
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'proposed-updates'), (500, 
'stable')
Architecture: i386 (i586)

Kernel: Linux 3.2.46-1-rt67-1
Locale: LANG=is_IS, LC_CTYPE=is_IS (charmap=ISO-8859-1)
Shell: /bin/sh linked to /bin/dash

Versions of packages adjtimex depends on:
ii  debconf [debconf-2.0]  1.5.49
ii  libc6                  2.13-38

adjtimex recommends no packages.

Versions of packages adjtimex suggests:
ii  ntpdate  1:4.2.6.p5+dfsg-2

-- Configuration Files:
/etc/init.d/adjtimex changed [not included]

-- debconf information:
  adjtimex/run_daemon: true
  adjtimex/compare_rtc: true

-- 
Bjarni I. Gislason

--- End Message ---
--- Begin Message ---
Source: adjtimex
Source-Version: 1.29-7

We believe that the bug you reported is fixed in the latest version of
adjtimex, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Roger Shimizu <[email protected]> (supplier of updated adjtimex package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Format: 1.8
Date: Thu, 17 Dec 2015 01:38:08 +0900
Source: adjtimex
Binary: adjtimex
Architecture: source
Version: 1.29-7
Distribution: unstable
Urgency: medium
Maintainer: Roger Shimizu <[email protected]>
Changed-By: Roger Shimizu <[email protected]>
Description:
 adjtimex   - kernel time variables configuration utility
Closes: 688933 724929 785208
Changes:
 adjtimex (1.29-7) unstable; urgency=medium
 .
   * remove the wrong debian/dirs line in changelog of previous version 1.29-6
   * debian/patches:
       - Replace patch 03 with the one by Bjarni I. Gislason, which also
         minimizes the time of lock over "/dev/rtc" (Closes: #724929).
       - Fix potential uninitialized memory accessing
         (thanks peppe <[email protected]>, Closes: #688933).
       - Avoid a few gcc warnings
   * debian/copyright: Add copyright for newly added patch
   * debian/adjtimexconfig:
       - Move tmp file during executing from /etc to /tmp.
       - Code clean up.
   * debian/templates + debian/config + debian/po + debian/NEWS:
       - Remove the debconf whether to start adjtimex on startup, which now
         depends on the existence of /etc/default/adjtimex file. By default,
         there's no /etc/default/adjtimex, which is generated by running:
         adjtimexconfig.
       - adjtimexconfig is still a choice in defconf, but change to false by
         default because it takes 70 seconds to excute on install/upgrade.
   * debian/postinst:
       - Refrain from running adjtimexconfig on configure, which is triggered by
         each install/upgrade
       - Refrain from starting adjtimex service on configure (Closes: #785208).
       - Code clean up.
   * debian/postrm:
       - Code clean up.
   * debian/adjtimex.init + debian/adjtimex.service: Start adjtimex service
       on startup only if config file /etc/default/adjtimex is ready.
   * debian/adjtimexconfig.8: Update man page
Checksums-Sha1:
 1c4020f9e3cbe40e2c3de7c2ef3614f4850a5f8d 1842 adjtimex_1.29-7.dsc
 30ac3a940f33bcc24b8bbc321dbc2c34f3a0f8e1 27736 adjtimex_1.29-7.debian.tar.xz
Checksums-Sha256:
 deb94b028d51151f9cea8368277ea6a94dcc2800891d4d7a616713d958af0e00 1842 
adjtimex_1.29-7.dsc
 c2276c0d4de6e6226033aa27041a013d4c60a331bab1f81c2b70ab49cc358329 27736 
adjtimex_1.29-7.debian.tar.xz
Files:
 b2301038b8be9b53050e592b46a0508f 1842 admin optional adjtimex_1.29-7.dsc
 ebfcbd045132c289d1ea728115a91d15 27736 admin optional 
adjtimex_1.29-7.debian.tar.xz

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQIcBAEBCAAGBQJWcvezAAoJEEsEP825REVAb9UP/RVxb4fkzRDRA71T8Fc7iCRc
mKXPtOivIiKK7hLxpXoGYx8EF6LBAlMI7qEeIN9yVf8xoxpDwvut6rCU1r1XEIhv
rQ00PcLSr+zk01893tAgQWTCmHrJbRqlk2iLGe/LGz3Jqz8CVqymaOxcR31DssCG
narAp7eTjHK7MqPCHycS2OOvQX7LNY5Vn7CFpspgh0rc9Wgz/SYF0cZa+o9/6yvZ
sY3aMbO0IfecFnyWQwa7Yr93cL2jYN7Oos6IFpDns2I5KgRrcve4hx9V/2OrcLk+
AyNEiz4MvfF2GNSJcRy4d2IPOsQVd04bBil5w51TEFoXZr2GqjEL4mHVDr8ZdH4D
9KsVWyiBuqNqGj09DfFvAnQrVb576t7LBczkO6nhuptGJXF3z7DdGQZU/0/m5MM8
MA1/aX3ewn7N3aie4soxP0TU8A6tw6oal627XTuI+PRYUW/3ncjEtsHT9DC5YE9G
FR/10LeRqMRyneSxYdmioMKSul8HUZsF8z6xOWXLbmKFh4D9UCBgXrLDkd2YEo+1
bDo365b1fvmqSm2Pq5J6E2LM0ffpnJfOHBaXvtoKlCDuwccmUESJEogpdnD+5upq
hzf3OvZUOipIrxzgXESh4WjD2yjj+gLR2as44dN8r5G5pc3hfea1V9sJDgEnUt12
P61SzNZuWddLWTfSeLQu
=e38Y
-----END PGP SIGNATURE-----

--- End Message ---

Reply via email to