diff options
author | jhb <jhb@FreeBSD.org> | 2014-10-06 18:16:45 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2014-10-06 18:16:45 +0000 |
commit | b7d50610ceb88b0441d7bb6d223ec1080a1d8e5e (patch) | |
tree | 02feae0b9305320f33b7dea099bfe61a14bd2113 /usr.sbin/nscd | |
parent | ec52dc2e32db4eb374eeab04e767bd78262daed7 (diff) | |
download | FreeBSD-src-b7d50610ceb88b0441d7bb6d223ec1080a1d8e5e.zip FreeBSD-src-b7d50610ceb88b0441d7bb6d223ec1080a1d8e5e.tar.gz |
Properly set the timeout in a query_state. The global query_timeout
configuration value is an integer count of seconds, it is not a timeval.
Using memcpy() to copy a timeval from it put garbage into the tv_usec
field.
PR: 194025
Submitted by: David Shane Holden <dpejesh@yahoo.com>
MFC after: 1 week
Diffstat (limited to 'usr.sbin/nscd')
-rw-r--r-- | usr.sbin/nscd/query.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/nscd/query.c b/usr.sbin/nscd/query.c index c233e19..270992e 100644 --- a/usr.sbin/nscd/query.c +++ b/usr.sbin/nscd/query.c @@ -1253,8 +1253,8 @@ init_query_state(int sockfd, size_t kevent_watermark, uid_t euid, gid_t egid) retval->read_func = query_socket_read; get_time_func(&retval->creation_time); - memcpy(&retval->timeout, &s_configuration->query_timeout, - sizeof(struct timeval)); + retval->timeout.tv_sec = s_configuration->query_timeout; + retval->timeout.tv_usec = 0; TRACE_OUT(init_query_state); return (retval); |