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
6df7adff
Commit
6df7adff
authored
Nov 30, 2011
by
Ken Thomases
Committed by
Alexandre Julliard
Dec 01, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winspool: Wait for and reap print spool child process.
parent
6c8929f8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
1 deletion
+32
-1
info.c
dlls/winspool.drv/info.c
+32
-1
No files found.
dlls/winspool.drv/info.c
View file @
6df7adff
...
...
@@ -33,6 +33,12 @@
#include <string.h>
#include <ctype.h>
#include <stddef.h>
#ifdef HAVE_SYS_ERRNO_H
#include <sys/errno.h>
#endif
#ifdef HAVE_SYS_WAIT_H
#include <sys/wait.h>
#endif
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
...
...
@@ -7408,6 +7414,8 @@ static BOOL schedule_pipe(LPCWSTR cmd, LPCWSTR filename)
int
fds
[
2
]
=
{
-
1
,
-
1
},
file_fd
=
-
1
,
no_read
;
BOOL
ret
=
FALSE
;
char
buf
[
1024
];
pid_t
pid
,
wret
;
int
status
;
if
(
!
(
unixname
=
wine_get_unix_file_name
(
filename
)))
return
FALSE
;
...
...
@@ -7427,7 +7435,7 @@ static BOOL schedule_pipe(LPCWSTR cmd, LPCWSTR filename)
goto
end
;
}
if
(
fork
(
)
==
0
)
if
(
(
pid
=
fork
()
)
==
0
)
{
close
(
0
);
dup2
(
fds
[
0
],
0
);
...
...
@@ -7439,10 +7447,33 @@ static BOOL schedule_pipe(LPCWSTR cmd, LPCWSTR filename)
execl
(
"/bin/sh"
,
"/bin/sh"
,
"-c"
,
cmdA
,
NULL
);
_exit
(
1
);
}
else
if
(
pid
==
-
1
)
{
ERR
(
"fork() failed!
\n
"
);
goto
end
;
}
while
((
no_read
=
read
(
file_fd
,
buf
,
sizeof
(
buf
)))
>
0
)
write
(
fds
[
1
],
buf
,
no_read
);
close
(
fds
[
1
]);
fds
[
1
]
=
-
1
;
/* reap child */
do
{
wret
=
waitpid
(
pid
,
&
status
,
0
);
}
while
(
wret
<
0
&&
errno
==
EINTR
);
if
(
wret
<
0
)
{
ERR
(
"waitpid() failed!
\n
"
);
goto
end
;
}
if
(
!
WIFEXITED
(
status
)
||
WEXITSTATUS
(
status
))
{
ERR
(
"child process failed! %d
\n
"
,
status
);
goto
end
;
}
ret
=
TRUE
;
end
:
...
...
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