Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 6 Oct 2014 18:16:46 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r272668 - head/usr.sbin/nscd
Message-ID:  <201410061816.s96IGkNp025779@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhb
Date: Mon Oct  6 18:16:45 2014
New Revision: 272668
URL: https://svnweb.freebsd.org/changeset/base/272668

Log:
  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

Modified:
  head/usr.sbin/nscd/query.c

Modified: head/usr.sbin/nscd/query.c
==============================================================================
--- head/usr.sbin/nscd/query.c	Mon Oct  6 18:15:13 2014	(r272667)
+++ head/usr.sbin/nscd/query.c	Mon Oct  6 18:16:45 2014	(r272668)
@@ -1253,8 +1253,8 @@ init_query_state(int sockfd, size_t keve
 	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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201410061816.s96IGkNp025779>