Do not assume that "struct timeval" and our "struct tmval" are equivalent.

Changed timeval_to_tm() to not cast a pointer to "struct timeval" to a pointer
to a "struct tmval" but rather perform a field copy.