Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(83)

Side by Side Diff: ports/glibc-compat/src/timegm.c

Issue 1260083004: Add needed functions to glibc-compat for pkg (Closed) Base URL: https://chromium.googlesource.com/external/naclports.git@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 /* Copyright 2015 The Native Client Authors. All rights reserved.
Sam Clegg 2015/07/28 00:14:13 nit: put /* and */ on lines be themselves to match
zhitingzhu 2015/07/28 02:05:41 Done.
2 * Use of this source code is governed by a BSD-style license that can be
3 * found in the LICENSE file. */
4 // pull from freebsd 10.1 ./contrib/ldns/compat/timegm.c
5 #include <stdio.h>
6 #include <stdlib.h>
7 #include <time.h>
8
9 time_t
10 timegm (struct tm *tm) {
11 time_t ret;
12 char *tz;
13
14 tz = getenv("TZ");
15 putenv((char*)"TZ=");
16 tzset();
17 ret = mktime(tm);
18 if (tz) {
19 char buf[256];
20 snprintf(buf, sizeof(buf), "TZ=%s", tz);
21 putenv(tz);
22 }
23 else
24 putenv((char*)"TZ");
25 tzset();
26 return ret;
27 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698