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
0425c0eb
Commit
0425c0eb
authored
Sep 24, 2015
by
Sebastian Lackner
Committed by
Alexandre Julliard
Oct 01, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Always switch back to server dir when open_fd returns.
Signed-off-by:
Sebastian Lackner
<
sebastian@fds-team.de
>
parent
205799d1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
9 deletions
+7
-9
fd.c
server/fd.c
+7
-9
No files found.
server/fd.c
View file @
0425c0eb
...
...
@@ -1835,34 +1835,31 @@ struct fd *open_fd( struct fd *root, const char *name, int flags, mode_t *mode,
fd
->
closed
=
closed_fd
;
fd
->
cacheable
=
!
inode
->
device
->
removable
;
list_add_head
(
&
inode
->
open
,
&
fd
->
inode_entry
);
closed_fd
=
NULL
;
/* check directory options */
if
((
options
&
FILE_DIRECTORY_FILE
)
&&
!
S_ISDIR
(
st
.
st_mode
))
{
release_object
(
fd
);
set_error
(
STATUS_NOT_A_DIRECTORY
);
return
NULL
;
goto
error
;
}
if
((
options
&
FILE_NON_DIRECTORY_FILE
)
&&
S_ISDIR
(
st
.
st_mode
))
{
release_object
(
fd
);
set_error
(
STATUS_FILE_IS_A_DIRECTORY
);
return
NULL
;
goto
error
;
}
if
((
err
=
check_sharing
(
fd
,
access
,
sharing
,
flags
,
options
)))
{
release_object
(
fd
);
set_error
(
err
);
return
NULL
;
goto
error
;
}
closed_f
d
->
unlink
=
(
options
&
FILE_DELETE_ON_CLOSE
)
!=
0
;
fd
->
close
d
->
unlink
=
(
options
&
FILE_DELETE_ON_CLOSE
)
!=
0
;
if
(
flags
&
O_TRUNC
)
{
if
(
S_ISDIR
(
st
.
st_mode
))
{
release_object
(
fd
);
set_error
(
STATUS_OBJECT_NAME_COLLISION
);
return
NULL
;
goto
error
;
}
ftruncate
(
fd
->
unix_fd
,
0
);
}
...
...
@@ -1877,6 +1874,7 @@ struct fd *open_fd( struct fd *root, const char *name, int flags, mode_t *mode,
free
(
closed_fd
);
fd
->
cacheable
=
1
;
}
if
(
root_fd
!=
-
1
)
fchdir
(
server_dir_fd
);
/* go back to the server dir */
return
fd
;
error:
...
...
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