Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
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
Иван Мажукин
mpd
Commits
504d3425
Commit
504d3425
authored
Aug 22, 2006
by
Eric Wong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
get rid of the pointless xopen wrapper, open(2) does not throw errno = EINTR
git-svn-id:
https://svn.musicpd.org/mpd/trunk@4663
09075e82-0dd4-0310-85a5-a0d7c8717e4f
parent
72c12ff7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
11 deletions
+4
-11
log.c
src/log.c
+4
-4
utils.h
src/utils.h
+0
-7
No files found.
src/log.c
View file @
504d3425
...
...
@@ -149,14 +149,14 @@ void open_log_files(const int use_stdout)
prev
=
umask
(
0066
);
param
=
parseConfigFilePath
(
CONF_LOG_FILE
,
1
);
out_filename
=
param
->
value
;
out_fd
=
x
open
(
out_filename
,
O_CREAT
|
O_WRONLY
|
O_APPEND
,
0666
);
out_fd
=
open
(
out_filename
,
O_CREAT
|
O_WRONLY
|
O_APPEND
,
0666
);
if
(
out_fd
<
0
)
FATAL
(
"problem opening log file
\"
%s
\"
(config line %i) for "
"writing
\n
"
,
param
->
value
,
param
->
line
);
param
=
parseConfigFilePath
(
CONF_ERROR_FILE
,
1
);
err_filename
=
param
->
value
;
err_fd
=
x
open
(
err_filename
,
O_CREAT
|
O_WRONLY
|
O_APPEND
,
0666
);
err_fd
=
open
(
err_filename
,
O_CREAT
|
O_WRONLY
|
O_APPEND
,
0666
);
if
(
err_fd
<
0
)
FATAL
(
"problem opening error file
\"
%s
\"
(config line %i) for "
"writing
\n
"
,
param
->
value
,
param
->
line
);
...
...
@@ -226,13 +226,13 @@ int cycle_log_files(void)
prev
=
umask
(
0066
);
out_fd
=
x
open
(
out_filename
,
O_CREAT
|
O_WRONLY
|
O_APPEND
,
0666
);
out_fd
=
open
(
out_filename
,
O_CREAT
|
O_WRONLY
|
O_APPEND
,
0666
);
if
(
out_fd
<
0
)
{
ERROR
(
"error re-opening log file: %s
\n
"
,
out_filename
);
return
-
1
;
}
err_fd
=
x
open
(
err_filename
,
O_CREAT
|
O_WRONLY
|
O_APPEND
,
0666
);
err_fd
=
open
(
err_filename
,
O_CREAT
|
O_WRONLY
|
O_APPEND
,
0666
);
if
(
err_fd
<
0
)
{
ERROR
(
"error re-opening error file: %s
\n
"
,
err_filename
);
return
-
1
;
...
...
src/utils.h
View file @
504d3425
...
...
@@ -46,13 +46,6 @@ char *appendToString(char *dest, const char *src);
unsigned
long
readLEuint32
(
const
unsigned
char
*
p
);
/* trivial functions, keep them inlined */
static
inline
int
xopen
(
const
char
*
path
,
int
flags
,
mode_t
mode
)
{
int
fd
;
while
(
0
>
(
fd
=
open
(
path
,
flags
,
mode
))
&&
errno
==
EINTR
);
return
fd
;
}
static
inline
void
xclose
(
int
fd
)
{
while
(
close
(
fd
)
&&
errno
==
EINTR
);
...
...
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