shithub: riscv

ref: fdf020f1309bffde33554f5a13c7b3a1a3fb1891
dir: /sys/src/libc/9sys/tm2sec.c/

View raw version
#include <u.h>
#include <libc.h>

long
tm2sec(Tm *tm)
{
	Tm tt;

	tt = *tm;
	/*
	 * The zone offset should be calculated,
	 * but old code may not init tz member.
	 * nil it out so we don't access junk.
	 * while we're at it, old code probably
	 * leaves junk in nsec.
	 */
	tt.nsec = 0;
	tt.tz = nil;
	return tmnorm(&tt);
}