summaryrefslogtreecommitdiff
path: root/package/gmediaserver/patches/patch-src_main_c
diff options
context:
space:
mode:
Diffstat (limited to 'package/gmediaserver/patches/patch-src_main_c')
-rw-r--r--package/gmediaserver/patches/patch-src_main_c158
1 files changed, 158 insertions, 0 deletions
diff --git a/package/gmediaserver/patches/patch-src_main_c b/package/gmediaserver/patches/patch-src_main_c
new file mode 100644
index 000000000..1348a67c8
--- /dev/null
+++ b/package/gmediaserver/patches/patch-src_main_c
@@ -0,0 +1,158 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- gmediaserver-0.13.0.orig/src/main.c 2007-10-20 11:41:37.000000000 +0200
++++ gmediaserver-0.13.0/src/main.c 2008-10-28 12:14:59.000000000 +0100
+@@ -32,8 +32,10 @@
+ #include <stdbool.h> /* Gnulib, C99 */
+ #include <signal.h> /* ? */
+ #include <locale.h> /* ? */
++#ifdef HAVE_ICONV
+ #include <iconv.h> /* Gnulib, POSIX */
+ #include "striconv.h" /* Gnulib */
++#endif
+ #ifdef HAVE_NL_LANGINFO
+ #include <langinfo.h>
+ #endif
+@@ -72,9 +74,11 @@ enum {
+ static const char *short_options = "bv::i:o:p:";
+ static struct option long_options[] = {
+ { "disable-tags", no_argument, NULL, OPT_DISABLE_TAGS },
++#ifdef HAVE_ICONV
+ { "fs-charset", required_argument, NULL, OPT_FS_CHARSET },
+ { "device-charset", required_argument, NULL, OPT_DEVICE_CHARSET },
+ { "log-charset", required_argument, NULL, OPT_LOG_CHARSET },
++#endif
+ { "friendly-name", required_argument, NULL, OPT_FRIENDLY_NAME },
+ { "pid-file", required_argument, NULL, OPT_PIDFILE },
+ { "profile", required_argument, NULL, OPT_PROFILE, },
+@@ -92,14 +96,17 @@ static struct option long_options[] = {
+ { NULL, 0, NULL, 0 }
+ };
+
++#ifdef HAVE_ICONV
+ static iconv_t utf8_to_device = (iconv_t) -1;
+ static iconv_t utf8_to_log = (iconv_t) -1;
+ static iconv_t fs_to_utf8 = (iconv_t) -1;
++#endif
+ const char version_etc_copyright[] = "Copyright (C) 2005, 2006 Oskar Liljeblad.";
+
+ char *
+ convert_string_to_device(const char *str)
+ {
++#ifdef HAVE_ICONV
+ char *out;
+ if (utf8_to_device == (iconv_t) -1)
+ return xstrdup(str);
+@@ -107,12 +114,15 @@ convert_string_to_device(const char *str
+ if (out != NULL)
+ return out;
+ warn(_("%s: cannot convert to device character set: %s\n"), quotearg(str), errstr);
++#else
+ return xstrdup(str);
++#endif
+ }
+
+ char *
+ convert_string_to_log(const char *str)
+ {
++#ifdef HAVE_ICONV
+ char *out;
+
+ if (utf8_to_log == (iconv_t) -1)
+@@ -121,7 +131,9 @@ convert_string_to_log(const char *str)
+ if (out != NULL)
+ return out;
+ /* Cannot warn here - would deadlock! */
++#else
+ return xstrdup(str);
++#endif
+ }
+
+ static char *cache_fs_str = NULL;
+@@ -129,6 +141,7 @@ static char *cache_fs_str = NULL;
+ char *
+ conv_filename(const char *str)
+ {
++#ifdef HAVE_ICONV
+ free(cache_fs_str);
+ if (fs_to_utf8 == (iconv_t) -1) {
+ cache_fs_str = xstrdup(str);
+@@ -140,6 +153,9 @@ conv_filename(const char *str)
+ }
+ }
+ return cache_fs_str;
++#else
++ return xstrdup(str);
++#endif
+ }
+
+ static void
+@@ -188,8 +204,10 @@ main(int argc, char **argv)
+ set_program_name(argv[0]);
+ set_quoting_style(0, escape_quoting_style);
+
++#ifdef LOCALE
+ if (setlocale(LC_ALL, "") == NULL)
+ warn(_("cannot set locale: %s\n"), errstr);
++#endif
+ #ifdef ENABLE_NLS
+ if (bindtextdomain(PACKAGE, LOCALEDIR) == NULL)
+ warn(_("cannot bind message domain: %s\n"), errstr);
+@@ -215,6 +233,7 @@ main(int argc, char **argv)
+ case OPT_DISABLE_TAGS:
+ tags_enabled = false;
+ break;
++#ifdef HAVE_ICONV
+ case OPT_FS_CHARSET:
+ fs_charset = optarg;
+ break;
+@@ -224,6 +243,7 @@ main(int argc, char **argv)
+ case OPT_LOG_CHARSET:
+ log_charset = optarg;
+ break;
++#endif
+ case OPT_FRIENDLY_NAME:
+ if (optarg[0] == '\0')
+ die(_("friendly name cannot be empty\n"));
+@@ -294,9 +314,11 @@ main(int argc, char **argv)
+ printf(_("Run the UPnP media server.\n\n"));
+ printf(_(" --friendly-name=NAME set display name for media server\n"));
+ printf(_(" --disable-tags do not scan files for tags\n"));
++#ifdef HAVE_ICONV
+ printf(_(" --fs-charset=CHARSET character set used in file names\n"));
+ printf(_(" --device-charset=CHARSET character set used in the player device\n"));
+ printf(_(" --log-charset=CHARSET character set used in logs and display\n"));
++#endif
+ printf(_(" -v, --verbose[=LEVEL] set verbosity level (0-4)\n"));
+ printf(_(" --pid-file=FILE write pid to FILE when up and running\n"));
+ printf(_(" -i, --interface=NAME listen on a specific interface\n"));
+@@ -371,6 +393,7 @@ main(int argc, char **argv)
+ if (fs_charset == NULL && getenv("G_BROKEN_FILENAMES") != NULL)
+ fs_charset = nl_langinfo(CODESET);
+ #endif
++#ifdef HAVE_ICONV
+ if (fs_charset != NULL) {
+ fs_to_utf8 = iconv_open("UTF-8", fs_charset);
+ if (fs_to_utf8 == (iconv_t) -1)
+@@ -395,6 +418,7 @@ main(int argc, char **argv)
+ die(_("cannot create character set convertor from %s to %s\n"), "UTF-8", quotearg(log_charset));
+ }
+ say(4, _("Using log character set %s\n"), quote(log_charset == NULL ? "UTF-8" : log_charset));
++#endif
+
+ init_logging(logfilename, timestamp_format);
+
+@@ -478,12 +502,14 @@ main(int argc, char **argv)
+
+ finish_logging(true);
+
++#ifdef HAVE_ICONV
+ if (fs_to_utf8 != (iconv_t) -1)
+ iconv_close(fs_to_utf8); /* ignore errors (only EINVAL) */
+ if (utf8_to_device != (iconv_t) -1)
+ iconv_close(utf8_to_device); /* ignore errors (only EINVAL) */
+ if (utf8_to_log != (iconv_t) -1)
+ iconv_close(utf8_to_log); /* ignore errors (only EINVAL) */
++#endif
+
+ free(cache_fs_str);
+