Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
efb8be7e
Commit
efb8be7e
authored
Oct 07, 2004
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added a fallback implementation of futimes.
parent
ac490fab
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
58 additions
and
2 deletions
+58
-2
file.c
dlls/ntdll/file.c
+1
-2
port.h
include/wine/port.h
+5
-0
Makefile.in
libs/port/Makefile.in
+1
-0
futimes.c
libs/port/futimes.c
+51
-0
No files found.
dlls/ntdll/file.c
View file @
efb8be7e
...
...
@@ -1064,7 +1064,6 @@ NTSTATUS WINAPI NtSetInformationFile(HANDLE handle, PIO_STATUS_BLOCK io,
struct
stat
st
;
const
FILE_BASIC_INFORMATION
*
info
=
ptr
;
#ifdef HAVE_FUTIMES
if
(
info
->
LastAccessTime
.
QuadPart
||
info
->
LastWriteTime
.
QuadPart
)
{
ULONGLONG
sec
,
nsec
;
...
...
@@ -1095,7 +1094,7 @@ NTSTATUS WINAPI NtSetInformationFile(HANDLE handle, PIO_STATUS_BLOCK io,
}
if
(
futimes
(
fd
,
tv
)
==
-
1
)
io
->
u
.
Status
=
FILE_GetNtStatus
();
}
#endif
/* HAVE_FUTIMES */
if
(
io
->
u
.
Status
==
STATUS_SUCCESS
&&
info
->
FileAttributes
)
{
if
(
fstat
(
fd
,
&
st
)
==
-
1
)
io
->
u
.
Status
=
FILE_GetNtStatus
();
...
...
include/wine/port.h
View file @
efb8be7e
...
...
@@ -282,6 +282,10 @@ extern int getopt_long_only (int ___argc, char *const *___argv,
const
struct
option
*
__longopts
,
int
*
__longind
);
#endif
/* HAVE_GETOPT_LONG */
#ifndef HAVE_FUTIMES
int
futimes
(
int
fd
,
const
struct
timeval
tv
[
2
]);
#endif
#ifndef HAVE_GETPAGESIZE
size_t
getpagesize
(
void
);
#endif
/* HAVE_GETPAGESIZE */
...
...
@@ -427,6 +431,7 @@ extern long interlocked_xchg_add( long *dest, long incr );
#define __WINE_NOT_PORTABLE(func) func##_is_not_portable func##_is_not_portable
#define fstatvfs __WINE_NOT_PORTABLE(fstatvfs)
#define futimes __WINE_NOT_PORTABLE(futimes)
#define getopt_long __WINE_NOT_PORTABLE(getopt_long)
#define getopt_long_only __WINE_NOT_PORTABLE(getopt_long_only)
#define getpagesize __WINE_NOT_PORTABLE(getpagesize)
...
...
libs/port/Makefile.in
View file @
efb8be7e
...
...
@@ -8,6 +8,7 @@ MODULE = libwine_port.a
C_SRCS
=
\
fstatvfs.c
\
futimes.c
\
getopt.c
\
getopt1.c
\
getpagesize.c
\
...
...
libs/port/futimes.c
0 → 100644
View file @
efb8be7e
/*
* futimes function
*
* Copyright 2004 Alexandre Julliard
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "config.h"
#include "wine/port.h"
#ifndef HAVE_FUTIMES
#include <sys/types.h>
#include <utime.h>
#include <stdio.h>
#include <errno.h>
int
futimes
(
int
fd
,
const
struct
timeval
tv
[
2
])
{
#ifdef linux
char
buffer
[
sizeof
(
"/proc/self/fd/"
)
+
3
*
sizeof
(
int
)];
sprintf
(
buffer
,
"/proc/self/fd/%u"
,
fd
);
if
(
tv
)
{
struct
utimbuf
ut
;
ut
.
actime
=
tv
[
0
].
tv_sec
+
(
tv
[
0
].
tv_usec
+
500000
)
/
1000000
;
ut
.
modtime
=
tv
[
1
].
tv_sec
+
(
tv
[
1
].
tv_usec
+
500000
)
/
1000000
;
return
utime
(
buffer
,
&
ut
);
}
else
return
utime
(
buffer
,
NULL
);
#else
errno
=
ENOSYS
;
return
-
1
;
#endif
}
#endif
/* HAVE_FUTIMES */
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