RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 730350 - rewrite rhnsd to use difftime
Summary: rewrite rhnsd to use difftime
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: rhnsd
Version: 6.1
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Tomas Lestach
QA Contact: Red Hat Satellite QA List
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-08-12 14:51 UTC by Tomas Lestach
Modified: 2018-11-27 17:29 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-12-09 09:05:44 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Tomas Lestach 2011-08-12 14:51:31 UTC
Description of problem:
In rhnsd an integer/float will be added to time_t, what is not recommended.
Instead of that difftime shall be used - in the way we do not add amount of seconds to time_t, but to go the other way around - to make a difference of two times in time_t

double difftime ( time_t time2, time_t time1 );
 Return difference between two times
 Calculates the difference in seconds between time1 and time2.
Parameters
 time2 - time_t object representing the latter of the two times.
 time1 - time_t object representing the earlier of the two times.
Return Value
 The difference in seconds (time2-time1) as a floating point double.


Version-Release number of selected component (if applicable):
rhnsd-4.9.3-3


Using
time_t + float(int)
isn't strictly defined and may cause troubles mainly in the future, when internal representation of time_t changes

difftime() is recommended for time differences and shall always return time difference in seconds (also in the future)

Comment 1 Jan Pazdziora 2011-11-23 16:07:11 UTC
Tomas, the comment 0 is fairly confusing. Could you please amend the bugzilla with Actual results and Expected results, so that we have something to work wich while acking the proposed change, not mentioning the fact that QA will want this to make a test plan (should we ever decide some change is called for)?

Your cooperation in this matter would be greatly appreciated.

Comment 2 Tomas Lestach 2011-11-24 09:43:12 UTC
As already discussed with Simon, there's no real test plan available.
Everything we can do is to:
# grep difftime client/rhel/rhnsd/rhnsd.c

Adding float to time_t doesn't return correct values, however the deviation is that small (lowest rhnsd interval is 1 hour) that it's not really possible for QA to detect the difference between the correct behavior and misbehavior.

This BZ doesn't address any visible misbehavior, it addresses the concept and usage of adding and comparing of date structures.

Comment 3 Jan Pazdziora 2011-11-24 10:33:01 UTC
Thank you, Tomáš. Setting devel ack then. Let's leave it on QA to decide if they'd be able to QA the change at all.

Comment 5 RHEL Program Management 2011-12-09 09:05:44 UTC
Quality Engineering Management has reviewed and declined this request.  You may
appeal this decision by reopening this request.


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