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

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
« 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.
Sam Clegg 2015/07/28 16:25:57 nit: newline here
zhitingzhu 2015/07/28 16:39:23 Done.
2 * Use of this source code is governed by a BSD-style license that can be
3 * found in the LICENSE file.
4 */
5 /* pull from freebsd 10.1 ./contrib/ldns/compat/timegm.c */
6 #include <stdio.h>
7 #include <stdlib.h>
8 #include <time.h>
9
10 time_t
11 timegm (struct tm *tm) {
12 time_t ret;
13 char *tz;
14
15 tz = getenv("TZ");
16 putenv((char*)"TZ=");
17 tzset();
18 ret = mktime(tm);
19 if (tz) {
20 char buf[256];
21 snprintf(buf, sizeof(buf), "TZ=%s", tz);
22 putenv(tz);
23 }
24 else
25 putenv((char*)"TZ");
26 tzset();
27 return ret;
28 }
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