Bug 25372

Summary: internal time service in inetd-0.16-7 is not working
Product: [Retired] Red Hat Linux Reporter: volf
Component: inetdAssignee: Jeff Johnson <jbj>
Status: CLOSED NOTABUG QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 6.2   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2001-01-31 14:42:24 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description volf 2001-01-31 08:17:59 UTC
Internal time service in inetd-0.16-7 is not working at all. This
"external" server:

==cut here==
#include <fcntl.h>
#include <sys/time.h>
#include <unistd.h>
#include <arpa/inet.h>
#include <syslog.h>

/* functions machtime and machtime_stream are taken from inetd sources and
slightly modified */
static unsigned long machtime(void)
{
        struct timeval tv;

        if (gettimeofday(&tv, (struct timezone *)0) < 0) {
                syslog(LOG_ERR, "Unable to get time of day\n");
                return (0L);
        }
        return (htonl((unsigned long)tv.tv_sec + 2208988800UL));
}

void machtime_stream(int s)
{
        unsigned long result;

        result = machtime();
        write(s, (char *) &result, sizeof(result));
}

int main (int argc, char **argv)
{
        openlog ("mytimed", LOG_PID | LOG_ODELAY, LOG_DAEMON);

        machtime_stream(0);

        closelog();

        return 0;
}
==cut here==

IS working on the same machine. What's wrong?

Comment 1 volf 2001-01-31 14:42:19 UTC
Now it is working. I don't know why. Probably there is something wrong between
the keyboard and the chair ;-) Sorry.