From bf22daa43718e858e6c8a1c32f48fa59f9e518bc Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim-Philipp=20M=C3=BCller?= Date: Mon, 6 Nov 2006 17:53:24 +0000 Subject: [PATCH] Use g_strerror() instead of strerror() - we want UTF-8. Original commit message from CVS: * gst/gstplugin.c: (gst_plugin_load_file): * plugins/elements/gstfilesrc.c: (gst_mmap_buffer_finalize), (gst_file_src_map_region), (gst_file_src_start): * plugins/indexers/gstfileindex.c: (gst_file_index_load), (gst_file_index_commit): Use g_strerror() instead of strerror() - we want UTF-8. --- ChangeLog | 9 +++++++++ gst/gstplugin.c | 4 ++-- plugins/elements/gstfilesrc.c | 11 ++++++----- plugins/indexers/gstfileindex.c | 7 ++++--- 4 files changed, 21 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index d4a1dd7..7be006d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,14 @@ 2006-11-06 Tim-Philipp Müller + * gst/gstplugin.c: (gst_plugin_load_file): + * plugins/elements/gstfilesrc.c: (gst_mmap_buffer_finalize), + (gst_file_src_map_region), (gst_file_src_start): + * plugins/indexers/gstfileindex.c: (gst_file_index_load), + (gst_file_index_commit): + Use g_strerror() instead of strerror() - we want UTF-8. + +2006-11-06 Tim-Philipp Müller + Patch by: Peter Kjellerstedt * plugins/elements/gstfdsrc.c: (gst_fd_src_create): diff --git a/gst/gstplugin.c b/gst/gstplugin.c index b59350e..64e4ee9 100644 --- a/gst/gstplugin.c +++ b/gst/gstplugin.c @@ -403,8 +403,8 @@ gst_plugin_load_file (const gchar * filename, GError ** error) GST_CAT_DEBUG (GST_CAT_PLUGIN_LOADING, "problem accessing file"); g_set_error (error, GST_PLUGIN_ERROR, - GST_PLUGIN_ERROR_MODULE, "Problem accessing file %s: %s\n", filename, - strerror (errno)); + GST_PLUGIN_ERROR_MODULE, "Problem accessing file %s: %s", filename, + g_strerror (errno)); goto return_error; } diff --git a/plugins/elements/gstfilesrc.c b/plugins/elements/gstfilesrc.c index 6ba26a4..3dae638 100644 --- a/plugins/elements/gstfilesrc.c +++ b/plugins/elements/gstfilesrc.c @@ -513,13 +513,13 @@ gst_mmap_buffer_finalize (GstMmapBuffer * mmap_buffer) #ifdef MADV_DONTNEED /* madvise to tell the kernel what to do with it */ if (madvise (data, size, MADV_DONTNEED) < 0) { - GST_WARNING_OBJECT (src, "warning: madvise failed: %s", strerror (errno)); + GST_WARNING_OBJECT (src, "warning: madvise failed: %s", g_strerror (errno)); } #endif /* now unmap the memory */ if (munmap (data, size) < 0) { - GST_WARNING_OBJECT (src, "warning: munmap failed: %s", strerror (errno)); + GST_WARNING_OBJECT (src, "warning: munmap failed: %s", g_strerror (errno)); } /* cast to unsigned long, since there's no gportable way to print @@ -558,7 +558,8 @@ gst_file_src_map_region (GstFileSrc * src, off_t offset, size_t size, if (src->sequential) { /* madvise to tell the kernel what to do with it */ if (madvise (mmapregion, size, MADV_SEQUENTIAL) < 0) { - GST_WARNING_OBJECT (src, "warning: madvise failed: %s", strerror (errno)); + GST_WARNING_OBJECT (src, "warning: madvise failed: %s", + g_strerror (errno)); } } #endif @@ -577,7 +578,7 @@ mmap_failed: if (!testonly) { GST_ELEMENT_ERROR (src, RESOURCE, OPEN_READ, (NULL), ("mmap (0x%08lx, %d, 0x%llx) failed: %s", - (gulong) size, src->fd, offset, strerror (errno))); + (gulong) size, src->fd, offset, g_strerror (errno))); } return NULL; } @@ -946,7 +947,7 @@ gst_file_src_start (GstBaseSrc * basesrc) if (res < 0) { GST_LOG_OBJECT (src, "disabling seeking, not in mmap mode and lseek " - "failed: %s", strerror (errno)); + "failed: %s", g_strerror (errno)); src->seekable = FALSE; } else { src->seekable = TRUE; diff --git a/plugins/indexers/gstfileindex.c b/plugins/indexers/gstfileindex.c index d9a7699..4d5bbe7 100644 --- a/plugins/indexers/gstfileindex.c +++ b/plugins/indexers/gstfileindex.c @@ -395,7 +395,7 @@ gst_file_index_load (GstFileIndex * index) g_free (path); if (fd < 0) { GST_ERROR_OBJECT (index, - "Can't open '%s': %s", path, strerror (errno)); + "Can't open '%s': %s", path, g_strerror (errno)); continue; } @@ -441,7 +441,7 @@ gst_file_index_load (GstFileIndex * index) close (fd); if (array_data == MAP_FAILED) { GST_ERROR_OBJECT (index, - "mmap %s failed: %s", path, strerror (errno)); + "mmap %s failed: %s", path, g_strerror (errno)); continue; } @@ -601,7 +601,8 @@ gst_file_index_commit (GstIndex * _index, gint _writer_id) (GHFunc) _file_index_id_save_xml, writers); if (mkdir (index->location, 0777) && errno != EEXIST) { - GST_ERROR_OBJECT (index, "mkdir %s: %s", index->location, strerror (errno)); + GST_ERROR_OBJECT (index, "mkdir %s: %s", index->location, + g_strerror (errno)); return; } -- 2.7.4