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
7c187717
Commit
7c187717
authored
Mar 11, 2002
by
Jason Phillips
Committed by
Alexandre Julliard
Mar 11, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make wineclipsrv run as a daemon (close stdout/stderr, no controlling
terminal, session group leader).
parent
46a9db64
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
0 deletions
+37
-0
wineclipsrv.c
windows/x11drv/wineclipsrv.c
+37
-0
No files found.
windows/x11drv/wineclipsrv.c
View file @
7c187717
...
...
@@ -188,6 +188,7 @@ static const char * const event_names[] =
* Prototypes
*/
int
RunAsDaemon
(
void
);
BOOL
Init
(
int
argc
,
char
**
argv
);
void
TerminateServer
(
int
ret
);
int
AcquireSelection
();
...
...
@@ -209,6 +210,12 @@ int main(int argc, char **argv)
{
XEvent
event
;
if
(
RunAsDaemon
()
==
-
1
)
{
ERR
(
"could not run as daemon
\n
"
);
exit
(
1
);
}
if
(
!
Init
(
argc
,
argv
)
)
exit
(
0
);
...
...
@@ -232,6 +239,36 @@ int main(int argc, char **argv)
/**************************************************************************
* RunAsDaemon()
*/
int
RunAsDaemon
(
void
)
{
int
i
;
/* fork child process and let parent exit ; gets rid of original PID */
switch
(
fork
()
)
{
case
-
1
:
ERR
(
"fork failed
\n
"
);
return
(
-
1
);
case
0
:
exit
(
0
);
break
;
}
/* below is child process w/ new PID, set as session leader */
setsid
();
/* close stdin,stdout,stderr and file descriptors (overkill method) */
for
(
i
=
0
;
i
<
256
;
i
++
)
close
(
i
);
TRACE
(
"now running as daemon...
\n
"
);
return
0
;
}
/**************************************************************************
* Init()
* Initialize the clipboard server
*/
...
...
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