Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
TLMSP curl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CYBER - Cyber Security
TS 103 523 MSP
TLMSP
TLMSP curl
Commits
a0edfb90
Commit
a0edfb90
authored
21 years ago
by
Daniel Stenberg
Browse files
Options
Downloads
Patches
Plain Diff
make our private version of gettimeofday() static
parent
93a85729
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/timeval.c
+24
-22
24 additions, 22 deletions
lib/timeval.c
with
24 additions
and
22 deletions
lib/timeval.c
+
24
−
22
View file @
a0edfb90
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 200
3
, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 200
4
, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
* are also available at http://curl.haxx.se/docs/copyright.html.
*
*
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
* copies of the Software, and permit persons to whom the Software is
* furnished to do so, under the terms of the COPYING file.
...
...
@@ -28,8 +28,7 @@
#ifdef WIN32
#include
<mmsystem.h>
int
gettimeofday
(
struct
timeval
*
tp
,
void
*
nothing
)
static
int
gettimeofday
(
struct
timeval
*
tp
,
void
*
nothing
)
{
#ifdef WITHOUT_MM_LIB
SYSTEMTIME
st
;
...
...
@@ -63,23 +62,26 @@ gettimeofday (struct timeval *tp, void *nothing)
Usec
=
(
Ticks
-
(
Sec
*
1000
))
*
1000
;
tp
->
tv_sec
=
Sec
;
tp
->
tv_usec
=
Usec
;
#endif
return
1
;
#endif
/* WITHOUT_MM_LIB */
return
0
;
}
#else
/* WIN32 */
/* non-win32 version of Curl_gettimeofday() */
static
int
gettimeofday
(
struct
timeval
*
tp
,
void
*
nothing
)
{
(
void
)
nothing
;
/* we don't support specific time-zones */
tp
->
tv_sec
=
(
long
)
time
(
NULL
);
tp
->
tv_usec
=
0
;
return
0
;
}
#define HAVE_GETTIMEOFDAY
#endif
#endif
#endif
/* WIN32 */
#endif
/* HAVE_GETTIMEOFDAY */
struct
timeval
Curl_tvnow
(
void
)
{
struct
timeval
now
;
#ifdef HAVE_GETTIMEOFDAY
gettimeofday
(
&
now
,
NULL
);
#else
now
.
tv_sec
=
(
long
)
time
(
NULL
);
now
.
tv_usec
=
0
;
#endif
return
now
;
struct
timeval
now
;
(
void
)
gettimeofday
(
&
now
,
NULL
);
return
now
;
}
/*
...
...
@@ -94,5 +96,5 @@ long Curl_tvdiff (struct timeval newer, struct timeval older)
long
Curl_tvlong
(
struct
timeval
t1
)
{
return
t1
.
tv_sec
;
return
t1
.
tv_sec
;
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment