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
5016839b
Commit
5016839b
authored
Mar 06, 2012
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use g_strerror() instead of strerror()
Make sure we get a UTF-8 encoded string.
parent
faf35e60
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
29 additions
and
28 deletions
+29
-28
aiff.c
src/aiff.c
+1
-1
command.c
src/command.c
+2
-1
conf.c
src/conf.c
+1
-1
ao_output_plugin.c
src/output/ao_output_plugin.c
+1
-1
fifo_output_plugin.c
src/output/fifo_output_plugin.c
+6
-6
mvp_output_plugin.c
src/output/mvp_output_plugin.c
+7
-7
oss_output_plugin.c
src/output/oss_output_plugin.c
+5
-5
riff.c
src/riff.c
+1
-1
state_file.c
src/state_file.c
+2
-2
tag_id3.c
src/tag_id3.c
+1
-1
run_filter.c
test/run_filter.c
+1
-1
signals.c
test/signals.c
+1
-1
No files found.
src/aiff.c
View file @
5016839b
...
@@ -57,7 +57,7 @@ aiff_seek_id3(FILE *file)
...
@@ -57,7 +57,7 @@ aiff_seek_id3(FILE *file)
ret
=
fstat
(
fileno
(
file
),
&
st
);
ret
=
fstat
(
fileno
(
file
),
&
st
);
if
(
ret
<
0
)
{
if
(
ret
<
0
)
{
g_warning
(
"Failed to stat file descriptor: %s"
,
g_warning
(
"Failed to stat file descriptor: %s"
,
strerror
(
errno
));
g_
strerror
(
errno
));
return
0
;
return
0
;
}
}
...
...
src/command.c
View file @
5016839b
...
@@ -117,7 +117,8 @@ print_playlist_result(struct client *client,
...
@@ -117,7 +117,8 @@ print_playlist_result(struct client *client,
return
COMMAND_RETURN_OK
;
return
COMMAND_RETURN_OK
;
case
PLAYLIST_RESULT_ERRNO
:
case
PLAYLIST_RESULT_ERRNO
:
command_error
(
client
,
ACK_ERROR_SYSTEM
,
"%s"
,
strerror
(
errno
));
command_error
(
client
,
ACK_ERROR_SYSTEM
,
"%s"
,
g_strerror
(
errno
));
return
COMMAND_RETURN_ERROR
;
return
COMMAND_RETURN_ERROR
;
case
PLAYLIST_RESULT_DENIED
:
case
PLAYLIST_RESULT_DENIED
:
...
...
src/conf.c
View file @
5016839b
...
@@ -350,7 +350,7 @@ config_read_file(const char *file, GError **error_r)
...
@@ -350,7 +350,7 @@ config_read_file(const char *file, GError **error_r)
if
(
!
(
fp
=
fopen
(
file
,
"r"
)))
{
if
(
!
(
fp
=
fopen
(
file
,
"r"
)))
{
g_set_error
(
error_r
,
config_quark
(),
errno
,
g_set_error
(
error_r
,
config_quark
(),
errno
,
"Failed to open %s: %s"
,
"Failed to open %s: %s"
,
file
,
strerror
(
errno
));
file
,
g_
strerror
(
errno
));
return
false
;
return
false
;
}
}
...
...
src/output/ao_output_plugin.c
View file @
5016839b
...
@@ -74,7 +74,7 @@ ao_output_error(GError **error_r)
...
@@ -74,7 +74,7 @@ ao_output_error(GError **error_r)
break
;
break
;
default:
default:
error
=
strerror
(
errno
);
error
=
g_
strerror
(
errno
);
}
}
g_set_error
(
error_r
,
ao_output_quark
(),
errno
,
g_set_error
(
error_r
,
ao_output_quark
(),
errno
,
...
...
src/output/fifo_output_plugin.c
View file @
5016839b
...
@@ -83,7 +83,7 @@ static void fifo_delete(struct fifo_data *fd)
...
@@ -83,7 +83,7 @@ static void fifo_delete(struct fifo_data *fd)
if
(
unlink
(
fd
->
path
)
<
0
)
{
if
(
unlink
(
fd
->
path
)
<
0
)
{
g_warning
(
"Could not remove FIFO
\"
%s
\"
: %s"
,
g_warning
(
"Could not remove FIFO
\"
%s
\"
: %s"
,
fd
->
path
,
strerror
(
errno
));
fd
->
path
,
g_
strerror
(
errno
));
return
;
return
;
}
}
...
@@ -115,7 +115,7 @@ fifo_make(struct fifo_data *fd, GError **error)
...
@@ -115,7 +115,7 @@ fifo_make(struct fifo_data *fd, GError **error)
if
(
mkfifo
(
fd
->
path
,
0666
)
<
0
)
{
if
(
mkfifo
(
fd
->
path
,
0666
)
<
0
)
{
g_set_error
(
error
,
fifo_output_quark
(),
errno
,
g_set_error
(
error
,
fifo_output_quark
(),
errno
,
"Couldn't create FIFO
\"
%s
\"
: %s"
,
"Couldn't create FIFO
\"
%s
\"
: %s"
,
fd
->
path
,
strerror
(
errno
));
fd
->
path
,
g_
strerror
(
errno
));
return
false
;
return
false
;
}
}
...
@@ -137,7 +137,7 @@ fifo_check(struct fifo_data *fd, GError **error)
...
@@ -137,7 +137,7 @@ fifo_check(struct fifo_data *fd, GError **error)
g_set_error
(
error
,
fifo_output_quark
(),
errno
,
g_set_error
(
error
,
fifo_output_quark
(),
errno
,
"Failed to stat FIFO
\"
%s
\"
: %s"
,
"Failed to stat FIFO
\"
%s
\"
: %s"
,
fd
->
path
,
strerror
(
errno
));
fd
->
path
,
g_
strerror
(
errno
));
return
false
;
return
false
;
}
}
...
@@ -161,7 +161,7 @@ fifo_open(struct fifo_data *fd, GError **error)
...
@@ -161,7 +161,7 @@ fifo_open(struct fifo_data *fd, GError **error)
if
(
fd
->
input
<
0
)
{
if
(
fd
->
input
<
0
)
{
g_set_error
(
error
,
fifo_output_quark
(),
errno
,
g_set_error
(
error
,
fifo_output_quark
(),
errno
,
"Could not open FIFO
\"
%s
\"
for reading: %s"
,
"Could not open FIFO
\"
%s
\"
for reading: %s"
,
fd
->
path
,
strerror
(
errno
));
fd
->
path
,
g_
strerror
(
errno
));
fifo_close
(
fd
);
fifo_close
(
fd
);
return
false
;
return
false
;
}
}
...
@@ -170,7 +170,7 @@ fifo_open(struct fifo_data *fd, GError **error)
...
@@ -170,7 +170,7 @@ fifo_open(struct fifo_data *fd, GError **error)
if
(
fd
->
output
<
0
)
{
if
(
fd
->
output
<
0
)
{
g_set_error
(
error
,
fifo_output_quark
(),
errno
,
g_set_error
(
error
,
fifo_output_quark
(),
errno
,
"Could not open FIFO
\"
%s
\"
for writing: %s"
,
"Could not open FIFO
\"
%s
\"
for writing: %s"
,
fd
->
path
,
strerror
(
errno
));
fd
->
path
,
g_
strerror
(
errno
));
fifo_close
(
fd
);
fifo_close
(
fd
);
return
false
;
return
false
;
}
}
...
@@ -255,7 +255,7 @@ fifo_output_cancel(struct audio_output *ao)
...
@@ -255,7 +255,7 @@ fifo_output_cancel(struct audio_output *ao)
if
(
bytes
<
0
&&
errno
!=
EAGAIN
)
{
if
(
bytes
<
0
&&
errno
!=
EAGAIN
)
{
g_warning
(
"Flush of FIFO
\"
%s
\"
failed: %s"
,
g_warning
(
"Flush of FIFO
\"
%s
\"
failed: %s"
,
fd
->
path
,
strerror
(
errno
));
fd
->
path
,
g_
strerror
(
errno
));
}
}
}
}
...
...
src/output/mvp_output_plugin.c
View file @
5016839b
...
@@ -128,7 +128,7 @@ mvp_output_test_default_device(void)
...
@@ -128,7 +128,7 @@ mvp_output_test_default_device(void)
}
}
g_warning
(
"Error opening PCM device
\"
/dev/adec_pcm
\"
: %s
\n
"
,
g_warning
(
"Error opening PCM device
\"
/dev/adec_pcm
\"
: %s
\n
"
,
strerror
(
errno
));
g_
strerror
(
errno
));
return
false
;
return
false
;
}
}
...
@@ -245,32 +245,32 @@ mvp_output_open(struct audio_output *ao, struct audio_format *audio_format,
...
@@ -245,32 +245,32 @@ mvp_output_open(struct audio_output *ao, struct audio_format *audio_format,
if
(
md
->
fd
<
0
)
{
if
(
md
->
fd
<
0
)
{
g_set_error
(
error
,
mvp_output_quark
(),
errno
,
g_set_error
(
error
,
mvp_output_quark
(),
errno
,
"Error opening /dev/adec_pcm: %s"
,
"Error opening /dev/adec_pcm: %s"
,
strerror
(
errno
));
g_
strerror
(
errno
));
return
false
;
return
false
;
}
}
if
(
ioctl
(
md
->
fd
,
MVP_SET_AUD_SRC
,
1
)
<
0
)
{
if
(
ioctl
(
md
->
fd
,
MVP_SET_AUD_SRC
,
1
)
<
0
)
{
g_set_error
(
error
,
mvp_output_quark
(),
errno
,
g_set_error
(
error
,
mvp_output_quark
(),
errno
,
"Error setting audio source: %s"
,
"Error setting audio source: %s"
,
strerror
(
errno
));
g_
strerror
(
errno
));
return
false
;
return
false
;
}
}
if
(
ioctl
(
md
->
fd
,
MVP_SET_AUD_STREAMTYPE
,
0
)
<
0
)
{
if
(
ioctl
(
md
->
fd
,
MVP_SET_AUD_STREAMTYPE
,
0
)
<
0
)
{
g_set_error
(
error
,
mvp_output_quark
(),
errno
,
g_set_error
(
error
,
mvp_output_quark
(),
errno
,
"Error setting audio streamtype: %s"
,
"Error setting audio streamtype: %s"
,
strerror
(
errno
));
g_
strerror
(
errno
));
return
false
;
return
false
;
}
}
if
(
ioctl
(
md
->
fd
,
MVP_SET_AUD_FORMAT
,
&
mix
)
<
0
)
{
if
(
ioctl
(
md
->
fd
,
MVP_SET_AUD_FORMAT
,
&
mix
)
<
0
)
{
g_set_error
(
error
,
mvp_output_quark
(),
errno
,
g_set_error
(
error
,
mvp_output_quark
(),
errno
,
"Error setting audio format: %s"
,
"Error setting audio format: %s"
,
strerror
(
errno
));
g_
strerror
(
errno
));
return
false
;
return
false
;
}
}
ioctl
(
md
->
fd
,
MVP_SET_AUD_STC
,
&
stc
);
ioctl
(
md
->
fd
,
MVP_SET_AUD_STC
,
&
stc
);
if
(
ioctl
(
md
->
fd
,
MVP_SET_AUD_BYPASS
,
1
)
<
0
)
{
if
(
ioctl
(
md
->
fd
,
MVP_SET_AUD_BYPASS
,
1
)
<
0
)
{
g_set_error
(
error
,
mvp_output_quark
(),
errno
,
g_set_error
(
error
,
mvp_output_quark
(),
errno
,
"Error setting audio streamtype: %s"
,
"Error setting audio streamtype: %s"
,
strerror
(
errno
));
g_
strerror
(
errno
));
return
false
;
return
false
;
}
}
...
@@ -326,7 +326,7 @@ mvp_output_play(struct audio_output *ao, const void *chunk, size_t size,
...
@@ -326,7 +326,7 @@ mvp_output_play(struct audio_output *ao, const void *chunk, size_t size,
continue
;
continue
;
g_set_error
(
error
,
mvp_output_quark
(),
errno
,
g_set_error
(
error
,
mvp_output_quark
(),
errno
,
"Failed to write: %s"
,
strerror
(
errno
));
"Failed to write: %s"
,
g_
strerror
(
errno
));
return
0
;
return
0
;
}
}
}
}
...
...
src/output/oss_output_plugin.c
View file @
5016839b
...
@@ -139,7 +139,7 @@ oss_output_test_default_device(void)
...
@@ -139,7 +139,7 @@ oss_output_test_default_device(void)
return
true
;
return
true
;
}
}
g_warning
(
"Error opening OSS device
\"
%s
\"
: %s
\n
"
,
g_warning
(
"Error opening OSS device
\"
%s
\"
: %s
\n
"
,
default_devices
[
i
],
strerror
(
errno
));
default_devices
[
i
],
g_
strerror
(
errno
));
}
}
return
false
;
return
false
;
...
@@ -184,7 +184,7 @@ oss_open_default(GError **error)
...
@@ -184,7 +184,7 @@ oss_open_default(GError **error)
break
;
break
;
case
OSS_STAT_OTHER
:
case
OSS_STAT_OTHER
:
g_warning
(
"Error accessing %s: %s
\n
"
,
g_warning
(
"Error accessing %s: %s
\n
"
,
dev
,
strerror
(
err
[
i
]));
dev
,
g_
strerror
(
err
[
i
]));
}
}
}
}
...
@@ -578,7 +578,7 @@ oss_reopen(struct oss_data *od, GError **error_r)
...
@@ -578,7 +578,7 @@ oss_reopen(struct oss_data *od, GError **error_r)
if
(
od
->
fd
<
0
)
{
if
(
od
->
fd
<
0
)
{
g_set_error
(
error_r
,
oss_output_quark
(),
errno
,
g_set_error
(
error_r
,
oss_output_quark
(),
errno
,
"Error opening OSS device
\"
%s
\"
: %s"
,
"Error opening OSS device
\"
%s
\"
: %s"
,
od
->
device
,
strerror
(
errno
));
od
->
device
,
g_
strerror
(
errno
));
return
false
;
return
false
;
}
}
...
@@ -632,7 +632,7 @@ oss_output_open(struct audio_output *ao, struct audio_format *audio_format,
...
@@ -632,7 +632,7 @@ oss_output_open(struct audio_output *ao, struct audio_format *audio_format,
if
(
od
->
fd
<
0
)
{
if
(
od
->
fd
<
0
)
{
g_set_error
(
error
,
oss_output_quark
(),
errno
,
g_set_error
(
error
,
oss_output_quark
(),
errno
,
"Error opening OSS device
\"
%s
\"
: %s"
,
"Error opening OSS device
\"
%s
\"
: %s"
,
od
->
device
,
strerror
(
errno
));
od
->
device
,
g_
strerror
(
errno
));
return
false
;
return
false
;
}
}
...
@@ -683,7 +683,7 @@ oss_output_play(struct audio_output *ao, const void *chunk, size_t size,
...
@@ -683,7 +683,7 @@ oss_output_play(struct audio_output *ao, const void *chunk, size_t size,
if
(
ret
<
0
&&
errno
!=
EINTR
)
{
if
(
ret
<
0
&&
errno
!=
EINTR
)
{
g_set_error
(
error
,
oss_output_quark
(),
errno
,
g_set_error
(
error
,
oss_output_quark
(),
errno
,
"Write error on %s: %s"
,
"Write error on %s: %s"
,
od
->
device
,
strerror
(
errno
));
od
->
device
,
g_
strerror
(
errno
));
return
0
;
return
0
;
}
}
}
}
...
...
src/riff.c
View file @
5016839b
...
@@ -57,7 +57,7 @@ riff_seek_id3(FILE *file)
...
@@ -57,7 +57,7 @@ riff_seek_id3(FILE *file)
ret
=
fstat
(
fileno
(
file
),
&
st
);
ret
=
fstat
(
fileno
(
file
),
&
st
);
if
(
ret
<
0
)
{
if
(
ret
<
0
)
{
g_warning
(
"Failed to stat file descriptor: %s"
,
g_warning
(
"Failed to stat file descriptor: %s"
,
strerror
(
errno
));
g_
strerror
(
errno
));
return
0
;
return
0
;
}
}
...
...
src/state_file.c
View file @
5016839b
...
@@ -58,7 +58,7 @@ state_file_write(struct player_control *pc)
...
@@ -58,7 +58,7 @@ state_file_write(struct player_control *pc)
fp
=
fopen
(
state_file_path
,
"w"
);
fp
=
fopen
(
state_file_path
,
"w"
);
if
(
G_UNLIKELY
(
!
fp
))
{
if
(
G_UNLIKELY
(
!
fp
))
{
g_warning
(
"failed to create %s: %s"
,
g_warning
(
"failed to create %s: %s"
,
state_file_path
,
strerror
(
errno
));
state_file_path
,
g_
strerror
(
errno
));
return
;
return
;
}
}
...
@@ -86,7 +86,7 @@ state_file_read(struct player_control *pc)
...
@@ -86,7 +86,7 @@ state_file_read(struct player_control *pc)
fp
=
fopen
(
state_file_path
,
"r"
);
fp
=
fopen
(
state_file_path
,
"r"
);
if
(
G_UNLIKELY
(
!
fp
))
{
if
(
G_UNLIKELY
(
!
fp
))
{
g_warning
(
"failed to open %s: %s"
,
g_warning
(
"failed to open %s: %s"
,
state_file_path
,
strerror
(
errno
));
state_file_path
,
g_
strerror
(
errno
));
return
;
return
;
}
}
...
...
src/tag_id3.c
View file @
5016839b
...
@@ -551,7 +551,7 @@ tag_id3_scan(const char *path_fs,
...
@@ -551,7 +551,7 @@ tag_id3_scan(const char *path_fs,
stream
=
fopen
(
path_fs
,
"rb"
);
stream
=
fopen
(
path_fs
,
"rb"
);
if
(
!
stream
)
{
if
(
!
stream
)
{
g_debug
(
"tag_id3_load: Failed to open file: '%s', %s"
,
g_debug
(
"tag_id3_load: Failed to open file: '%s', %s"
,
path_fs
,
strerror
(
errno
));
path_fs
,
g_
strerror
(
errno
));
return
false
;
return
false
;
}
}
...
...
test/run_filter.c
View file @
5016839b
...
@@ -183,7 +183,7 @@ int main(int argc, char **argv)
...
@@ -183,7 +183,7 @@ int main(int argc, char **argv)
nbytes
=
write
(
1
,
dest
,
length
);
nbytes
=
write
(
1
,
dest
,
length
);
if
(
nbytes
<
0
)
{
if
(
nbytes
<
0
)
{
g_printerr
(
"Failed to write: %s
\n
"
,
strerror
(
errno
));
g_printerr
(
"Failed to write: %s
\n
"
,
g_
strerror
(
errno
));
filter_close
(
filter
);
filter_close
(
filter
);
filter_free
(
filter
);
filter_free
(
filter
);
return
1
;
return
1
;
...
...
test/signals.c
View file @
5016839b
...
@@ -39,7 +39,7 @@ static void
...
@@ -39,7 +39,7 @@ static void
x_sigaction
(
int
signum
,
const
struct
sigaction
*
act
)
x_sigaction
(
int
signum
,
const
struct
sigaction
*
act
)
{
{
if
(
sigaction
(
signum
,
act
,
NULL
)
<
0
)
if
(
sigaction
(
signum
,
act
,
NULL
)
<
0
)
MPD_ERROR
(
"sigaction() failed: %s"
,
strerror
(
errno
));
MPD_ERROR
(
"sigaction() failed: %s"
,
g_
strerror
(
errno
));
}
}
#endif
#endif
...
...
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