Re: status of release 1.1

Markus Wanner <[email protected]>
Newsgroups gmane.comp.version-control.monotone.devel
Message-ID <[email protected]>
On 05/03/2014 11:46 PM, Thomas Keller wrote:
> I'm running a 64 bit OS X and your test program reports "mktime seems okay".

Thanks. Surprises me. Although: I had a time zone issue in that test
program itself, though.

I could finally arrange for an Mac OS X box (Mountain Lion) that
thankfully reproduced the issue. I'm just about to commit a fix.
Attached a corrected variant of the test code. On my Mac OS X box it
yields: Lower boundary wrong (got -1)

I'm now looking into the ssh_agent failure.

Regards

Markus Wanner

_______________________________________________
Monotone-devel mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/monotone-devel
test2.cc (text/x-c++src, 1017 B)
#include <iostream>
#include <cstdlib>
#include <ctime>

int main() {
  /* not an issue if not 64-bit */
  if (sizeof(struct tm) <= 4)
	return EXIT_SUCCESS;

  setenv("TZ", "UTC", 1);

  /* just within the 32-bit boundaries */
  struct tm tb_upper = { 7, 14, 3, 19, 0, 138, 0, 0, -1 };
  struct tm tb_lower = { 52, 45, 20, 13, 11, 1, 0, 0, -1 };

  time_t i_upper = std::mktime(&tb_upper);
  time_t i_lower = std::mktime(&tb_lower);

  /* step over the boundaries */
  tb_upper.tm_sec += 1;
  tb_lower.tm_sec -= 1;

  time_t o_upper = std::mktime(&tb_upper);
  time_t o_lower = std::mktime(&tb_lower);

  if (o_upper == -1)
	std::cout << "Upper boundary wrong (got -1)\n";
  else if (o_upper - i_upper != 1)
	std::cout << "Upper boundary wrong (differs by "
			  << (o_upper - i_upper) << ")\n";

  if (o_lower == -1)
	std::cout << "Lower boundary wrong (got -1)\n";
  else if (o_lower - i_lower != -1)
	std::cout << "Lower boundary wrong (differs by "
			  << (o_lower - i_lower) << ")\n";

  return EXIT_SUCCESS;
}
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.