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

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: fix wrong c++ lib 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
« no previous file with comments | « ports/glibc-compat/src/test.cc ('k') | ports/glibc-compat/src/writev.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /* Copyright 2015 The Native Client Authors. All rights reserved.
2 *
3 * Use of this source code is governed by a BSD-style license that can be
4 * found in the LICENSE file.
5 */
6 /* pull from freebsd 10.1 ./contrib/ldns/compat/timegm.c */
7 #include <stdio.h>
8 #include <stdlib.h>
9 #include <time.h>
10
11 time_t
12 timegm (struct tm *tm) {
13 time_t ret;
14 char *tz;
15
16 tz = getenv("TZ");
17 putenv((char*)"TZ=");
18 tzset();
19 ret = mktime(tm);
20 if (tz) {
21 char buf[256];
22 snprintf(buf, sizeof(buf), "TZ=%s", tz);
23 putenv(tz);
24 }
25 else
26 putenv((char*)"TZ");
27 tzset();
28 return ret;
29 }
OLDNEW
« no previous file with comments | « ports/glibc-compat/src/test.cc ('k') | ports/glibc-compat/src/writev.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698