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
c5c599d4
Commit
c5c599d4
authored
Mar 31, 2006
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Avoid crash on startup when the configuration dir doesn't exist.
parent
510a6f70
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
5 deletions
+13
-5
request.c
server/request.c
+13
-5
No files found.
server/request.c
View file @
c5c599d4
...
...
@@ -528,12 +528,12 @@ static void create_dir( const char *name, struct stat *st )
}
/* create the server directory and chdir to it */
static
void
create_server_dir
(
void
)
static
void
create_server_dir
(
const
char
*
dir
)
{
char
*
p
,
*
server_dir
;
struct
stat
st
,
st2
;
if
(
!
(
server_dir
=
strdup
(
wine_get_server_dir
()
)))
fatal_error
(
"out of memory
\n
"
);
if
(
!
(
server_dir
=
strdup
(
dir
)))
fatal_error
(
"out of memory
\n
"
);
/* first create the base directory if needed */
...
...
@@ -579,10 +579,13 @@ static int create_server_lock(void)
/* wait for the server lock */
int
wait_for_lock
(
void
)
{
const
char
*
server_dir
=
wine_get_server_dir
();
int
fd
,
r
;
struct
flock
fl
;
create_server_dir
();
if
(
!
server_dir
)
return
0
;
/* no server dir, so no lock to wait on */
create_server_dir
(
server_dir
);
fd
=
create_server_lock
();
fl
.
l_type
=
F_WRLCK
;
...
...
@@ -598,11 +601,14 @@ int wait_for_lock(void)
/* kill the wine server holding the lock */
int
kill_lock_owner
(
int
sig
)
{
const
char
*
server_dir
=
wine_get_server_dir
();
int
fd
,
i
,
ret
=
0
;
pid_t
pid
=
0
;
struct
flock
fl
;
create_server_dir
();
if
(
!
server_dir
)
return
0
;
/* no server dir, nothing to do */
create_server_dir
(
server_dir
);
fd
=
create_server_lock
();
for
(
i
=
0
;
i
<
10
;
i
++
)
...
...
@@ -721,6 +727,7 @@ static void acquire_lock(void)
/* open the master server socket and start waiting for new clients */
void
open_master_socket
(
void
)
{
const
char
*
server_dir
=
wine_get_server_dir
();
int
fd
,
pid
,
status
,
sync_pipe
[
2
];
char
dummy
;
...
...
@@ -728,7 +735,8 @@ void open_master_socket(void)
assert
(
sizeof
(
union
generic_request
)
==
sizeof
(
struct
request_max_size
)
);
assert
(
sizeof
(
union
generic_reply
)
==
sizeof
(
struct
request_max_size
)
);
create_server_dir
();
if
(
!
server_dir
)
fatal_error
(
"directory %s cannot be accessed
\n
"
,
wine_get_config_dir
()
);
create_server_dir
(
server_dir
);
if
(
!
foreground
)
{
...
...
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