~ubuntu-branches/ubuntu/utopic/coreutils/utopic-proposed

« back to all changes in this revision

Viewing changes to lib/gettimeofday.c

  • Committer: Package Import Robot
  • Author(s): Colin Watson
  • Date: 2012-11-28 03:03:42 UTC
  • mfrom: (8.3.4 sid)
  • Revision ID: package-import@ubuntu.com-20121128030342-21zanj8354gas5gr
Tags: 8.20-3ubuntu1
* Resynchronise with Debian.  Remaining changes:
  - Make 'uname -i -p' return the real processor/hardware, instead of
    unknown.
  - Build-depend on gettext:any instead of on gettext, so that apt-get can
    properly resolve build-dependencies on the tool when cross-building.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* -*- buffer-read-only: t -*- vi: set ro: */
2
 
/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
3
1
/* Provide gettimeofday for systems that don't have it or for which it's broken.
4
2
 
5
 
   Copyright (C) 2001-2003, 2005-2007, 2009-2011 Free Software Foundation, Inc.
 
3
   Copyright (C) 2001-2003, 2005-2007, 2009-2012 Free Software Foundation, Inc.
6
4
 
7
5
   This program is free software; you can redistribute it and/or modify
8
6
   it under the terms of the GNU General Public License as published by
15
13
   GNU General Public License for more details.
16
14
 
17
15
   You should have received a copy of the GNU General Public License
18
 
   along with this program; if not, write to the Free Software Foundation,
19
 
   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
 
16
   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
20
17
 
21
18
/* written by Jim Meyering */
22
19
 
112
109
  struct tm save = *localtime_buffer_addr;
113
110
# endif
114
111
 
 
112
# if defined timeval /* 'struct timeval' overridden by gnulib?  */
 
113
#  undef timeval
 
114
  struct timeval otv;
 
115
  int result = gettimeofday (&otv, (struct timezone *) tz);
 
116
  if (result == 0)
 
117
    {
 
118
      tv->tv_sec = otv.tv_sec;
 
119
      tv->tv_usec = otv.tv_usec;
 
120
    }
 
121
# else
115
122
  int result = gettimeofday (tv, (struct timezone *) tz);
 
123
# endif
116
124
 
117
125
# if GETTIMEOFDAY_CLOBBERS_LOCALTIME
118
126
  *localtime_buffer_addr = save;