Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
136fae57
Commit
136fae57
authored
Mar 11, 2002
by
Patrik Stridvall
Committed by
Alexandre Julliard
Mar 11, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Better handling when settimeofday is not available.
- Adding name translations for p{close,open} and str{,n}casecmp if they exists under other names.
parent
81ecb52c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
21 deletions
+41
-21
time.c
dlls/kernel/time.c
+12
-0
port.h
include/wine/port.h
+26
-6
port.c
library/port.c
+3
-15
No files found.
dlls/kernel/time.c
View file @
136fae57
...
...
@@ -18,6 +18,8 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "config.h"
#include <string.h>
#include <unistd.h>
#include <stdlib.h>
...
...
@@ -319,10 +321,15 @@ BOOL WINAPI SetLocalTime(
err
=
1
;
SetLastError
(
ERROR_INVALID_PARAMETER
);
}
else
{
#ifdef HAVE_SETTIMEOFDAY
err
=
settimeofday
(
&
tv
,
NULL
);
/* 0 is OK, -1 is error */
if
(
err
==
0
)
return
TRUE
;
SetLastError
(
ERROR_PRIVILEGE_NOT_HELD
);
#else
err
=
1
;
SetLastError
(
ERROR_CALL_NOT_IMPLEMENTED
);
#endif
}
ERR
(
"Cannot set time to %d/%d/%d %d:%d:%d Time adjustment %ld %s
\n
"
,
systime
->
wYear
,
systime
->
wMonth
,
systime
->
wDay
,
systime
->
wHour
,
...
...
@@ -407,10 +414,15 @@ BOOL WINAPI SetSystemTime(
err
=
1
;
SetLastError
(
ERROR_INVALID_PARAMETER
);
}
else
{
#ifdef HAVE_SETTIMEOFDAY
err
=
settimeofday
(
&
tv
,
NULL
);
/* 0 is OK, -1 is error */
if
(
err
==
0
)
return
TRUE
;
SetLastError
(
ERROR_PRIVILEGE_NOT_HELD
);
#else
err
=
1
;
SetLastError
(
ERROR_CALL_NOT_IMPLEMENTED
);
#endif
}
ERR
(
"Cannot set time to %d/%d/%d %d:%d:%d Time adjustment %ld %s
\n
"
,
systime
->
wYear
,
systime
->
wMonth
,
systime
->
wDay
,
systime
->
wHour
,
...
...
include/wine/port.h
View file @
136fae57
...
...
@@ -28,9 +28,17 @@
#define _GNU_SOURCE
/* for pread/pwrite */
#include <fcntl.h>
#include <sys/types.h>
#include <sys/time.h>
#include <sys/stat.h>
#include <unistd.h>
#ifdef HAVE_DIRECT_H
# include <direct.h>
#endif
#ifdef HAVE_IO_H
# include <io.h>
#endif
#include <string.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
/* Types */
...
...
@@ -117,16 +125,16 @@ size_t getpagesize(void);
unsigned
long
inet_network
(
const
char
*
cp
);
#endif
/* !defined(HAVE_INET_NETWORK) */
#ifndef HAVE_SETTIMEOFDAY
int
settimeofday
(
struct
timeval
*
tp
,
void
*
reserved
);
#endif
/* !defined(HAVE_SETTIMEOFDAY) */
#ifndef HAVE_STATFS
int
statfs
(
const
char
*
name
,
struct
statfs
*
info
);
#endif
/* !defined(HAVE_STATFS) */
#ifndef HAVE_STRNCASECMP
# ifndef HAVE__STRNICMP
int
strncasecmp
(
const
char
*
str1
,
const
char
*
str2
,
size_t
n
);
# else
# define strncasecmp _strnicmp
# endif
#endif
/* !defined(HAVE_STRNCASECMP) */
#ifndef HAVE_OPENPTY
...
...
@@ -140,7 +148,11 @@ const char *strerror(int err);
#endif
/* !defined(HAVE_STRERROR) */
#ifndef HAVE_STRCASECMP
# ifndef HAVE__STRICMP
int
strcasecmp
(
const
char
*
str1
,
const
char
*
str2
);
# else
# define strcasecmp _stricmp
# endif
#endif
/* !defined(HAVE_STRCASECMP) */
#ifndef HAVE_USLEEP
...
...
@@ -151,6 +163,14 @@ int usleep (unsigned int useconds);
int
lstat
(
const
char
*
file_name
,
struct
stat
*
buf
);
#endif
/* HAVE_LSTAT */
#if !defined(HAVE_POPEN) && defined(HAVE__POPEN)
#define popen _popen
#endif
#if !defined(HAVE_PCLOSE) && defined(HAVE__PCLOSE)
#define pclose _pclose
#endif
#ifndef HAVE_PREAD
ssize_t
pread
(
int
fd
,
void
*
buf
,
size_t
count
,
off_t
offset
);
#endif
/* HAVE_PREAD */
...
...
library/port.c
View file @
136fae57
...
...
@@ -33,7 +33,9 @@
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/time.h>
#ifdef HAVE_SYS_TIME_h
# include <sys/time.h>
#endif
#include <sys/stat.h>
#include <sys/ioctl.h>
#include <errno.h>
...
...
@@ -333,20 +335,6 @@ unsigned long inet_network(const char *cp)
#endif
/* defined(HAVE_INET_NETWORK) */
/***********************************************************************
* settimeofday
*/
#ifndef HAVE_SETTIMEOFDAY
int
settimeofday
(
struct
timeval
*
tp
,
void
*
reserved
)
{
tp
->
tv_sec
=
0
;
tp
->
tv_usec
=
0
;
errno
=
ENOSYS
;
return
-
1
;
}
#endif
/* HAVE_SETTIMEOFDAY */
/***********************************************************************
* statfs
*/
#ifndef HAVE_STATFS
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment