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
27db3095
Commit
27db3095
authored
Mar 30, 2004
by
Ferenc Wagner
Committed by
Alexandre Julliard
Mar 30, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't expect stdout be usable after exchanging file descriptors under
it.
parent
29623c2e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
15 deletions
+30
-15
main.c
programs/winetest/main.c
+0
-2
util.c
programs/winetest/util.c
+30
-13
No files found.
programs/winetest/main.c
View file @
27db3095
...
...
@@ -335,8 +335,6 @@ run_tests (char *logname, const char *tag)
SetErrorMode
(
SEM_FAILCRITICALERRORS
);
if
(
!
(
wineloader
=
getenv
(
"WINELOADER"
)))
wineloader
=
"wine"
;
if
(
setvbuf
(
stdout
,
NULL
,
_IONBF
,
0
))
report
(
R_FATAL
,
"Can't unbuffer output."
);
tempdir
=
tempnam
(
0
,
"wct"
);
if
(
!
tempdir
)
...
...
programs/winetest/util.c
View file @
27db3095
...
...
@@ -19,6 +19,7 @@
*
*/
#include <windows.h>
#include <unistd.h>
#include <errno.h>
#include "winetest.h"
...
...
@@ -39,26 +40,14 @@ void *xrealloc (void *op, size_t len)
return
p
;
}
void
xprintf
(
const
char
*
fmt
,
...)
{
va_list
ap
;
va_start
(
ap
,
fmt
);
if
(
vprintf
(
fmt
,
ap
)
<
0
)
report
(
R_FATAL
,
"Can't write logs: %d"
,
errno
);
va_end
(
ap
);
}
char
*
vstrmake
(
size_t
*
lenp
,
va_list
ap
)
char
*
vstrfmtmake
(
size_t
*
lenp
,
const
char
*
fmt
,
va_list
ap
)
{
char
*
fmt
;
size_t
size
=
1000
;
char
*
p
,
*
q
;
int
n
;
p
=
malloc
(
size
);
if
(
!
p
)
return
NULL
;
fmt
=
va_arg
(
ap
,
char
*
);
while
(
1
)
{
n
=
vsnprintf
(
p
,
size
,
fmt
,
ap
);
if
(
n
<
0
)
size
*=
2
;
/* Windows */
...
...
@@ -75,6 +64,14 @@ char *vstrmake (size_t *lenp, va_list ap)
return
p
;
}
char
*
vstrmake
(
size_t
*
lenp
,
va_list
ap
)
{
const
char
*
fmt
;
fmt
=
va_arg
(
ap
,
const
char
*
);
return
vstrfmtmake
(
lenp
,
fmt
,
ap
);
}
char
*
strmake
(
size_t
*
lenp
,
...)
{
va_list
ap
;
...
...
@@ -87,6 +84,26 @@ char *strmake (size_t *lenp, ...)
return
p
;
}
void
xprintf
(
const
char
*
fmt
,
...)
{
va_list
ap
;
size_t
size
;
ssize_t
written
;
char
*
buffer
,
*
head
;
va_start
(
ap
,
fmt
);
buffer
=
vstrfmtmake
(
&
size
,
fmt
,
ap
);
head
=
buffer
;
va_end
(
ap
);
while
((
written
=
write
(
1
,
head
,
size
))
!=
size
)
{
if
(
written
==
-
1
)
report
(
R_FATAL
,
"Can't write logs: %d"
,
errno
);
head
+=
written
;
size
-=
written
;
}
free
(
buffer
);
}
char
*
badtagchar
(
char
*
tag
)
{
...
...
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