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
d82a4aff
Commit
d82a4aff
authored
Jun 30, 2008
by
Eric Wong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
utils: pthread_{mutex,cond}_init can fail, so check for it
git-svn-id:
https://svn.musicpd.org/mpd/trunk@7394
09075e82-0dd4-0310-85a5-a0d7c8717e4f
parent
2a5dcba5
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
0 deletions
+18
-0
utils.c
src/utils.c
+14
-0
utils.h
src/utils.h
+4
-0
No files found.
src/utils.c
View file @
d82a4aff
...
@@ -241,6 +241,20 @@ void init_async_pipe(int file_des[2])
...
@@ -241,6 +241,20 @@ void init_async_pipe(int file_des[2])
FATAL
(
"Couldn't set non-blocking I/O: %s
\n
"
,
strerror
(
errno
));
FATAL
(
"Couldn't set non-blocking I/O: %s
\n
"
,
strerror
(
errno
));
}
}
void
xpthread_mutex_init
(
pthread_mutex_t
*
m
,
const
pthread_mutexattr_t
*
a
)
{
int
err
;
if
((
err
=
pthread_mutex_init
(
m
,
a
)))
FATAL
(
"failed to init mutex: %s
\n
"
,
strerror
(
err
));
}
void
xpthread_cond_init
(
pthread_cond_t
*
c
,
pthread_condattr_t
*
a
)
{
int
err
;
if
((
err
=
pthread_cond_init
(
c
,
a
)))
FATAL
(
"failed to init cond: %s
\n
"
,
strerror
(
err
));
}
void
xpthread_mutex_destroy
(
pthread_mutex_t
*
mutex
)
void
xpthread_mutex_destroy
(
pthread_mutex_t
*
mutex
)
{
{
int
err
;
int
err
;
...
...
src/utils.h
View file @
d82a4aff
...
@@ -82,6 +82,10 @@ int set_nonblocking(int fd);
...
@@ -82,6 +82,10 @@ int set_nonblocking(int fd);
void
init_async_pipe
(
int
file_des
[
2
]);
void
init_async_pipe
(
int
file_des
[
2
]);
void
xpthread_mutex_init
(
pthread_mutex_t
*
m
,
const
pthread_mutexattr_t
*
a
);
void
xpthread_cond_init
(
pthread_cond_t
*
c
,
pthread_condattr_t
*
a
);
void
xpthread_mutex_destroy
(
pthread_mutex_t
*
mutex
);
void
xpthread_mutex_destroy
(
pthread_mutex_t
*
mutex
);
void
xpthread_cond_destroy
(
pthread_cond_t
*
cond
);
void
xpthread_cond_destroy
(
pthread_cond_t
*
cond
);
...
...
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