summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Beierlein <tomjbe@gentoo.org>2022-03-20 15:42:22 +0100
committerThomas Beierlein <tomjbe@gentoo.org>2022-03-20 15:42:22 +0100
commitbd4276c164ab0e8cd3bd81d75f9275de11338a04 (patch)
treeec05b4feb9b8d3405fd090ccc35626c14d98091d /media-radio/xlog
parentnet-wireless/nanovna-saver: Version bump (diff)
downloadgentoo-bd4276c164ab0e8cd3bd81d75f9275de11338a04.tar.gz
gentoo-bd4276c164ab0e8cd3bd81d75f9275de11338a04.tar.bz2
gentoo-bd4276c164ab0e8cd3bd81d75f9275de11338a04.zip
media-radio/xlog: Avoid writing to read only stderr varaible in musl C
Closes: https://bugs.gentoo.org/832236 Signed-off-by: Thomas Beierlein <tomjbe@gentoo.org>
Diffstat (limited to 'media-radio/xlog')
-rw-r--r--media-radio/xlog/files/xlog-2.0.24-musl.patch51
-rw-r--r--media-radio/xlog/xlog-2.0.24.ebuild3
2 files changed, 53 insertions, 1 deletions
diff --git a/media-radio/xlog/files/xlog-2.0.24-musl.patch b/media-radio/xlog/files/xlog-2.0.24-musl.patch
new file mode 100644
index 000000000000..a235f37e45dc
--- /dev/null
+++ b/media-radio/xlog/files/xlog-2.0.24-musl.patch
@@ -0,0 +1,51 @@
+Avoid assignment to read only stderr variable
+Bug #832236
+diff --git a/src/gui_tracedialog.c b/src/gui_tracedialog.c
+index a00020e..52b6c76 100644
+--- a/src/gui_tracedialog.c
++++ b/src/gui_tracedialog.c
+@@ -32,6 +32,7 @@
+ #include <unistd.h>
+ #include <glib/gstdio.h>
+ #include <hamlib/rig.h>
++#include <fcntl.h>
+
+ #include "gui_tracedialog.h"
+ #include "gui_warningdialog.h"
+@@ -43,7 +44,7 @@ typedef struct
+ {
+ time_t modified; /* Last Modified Time */
+ gchar *filename; /* File Name */
+- FILE *fd; /* File Descriptor */
++ gint filedesc; /* File Descriptor */
+ unsigned long filesize; /* File Size */
+ } fileinfo;
+
+@@ -62,14 +63,9 @@ stop_tracing (void)
+
+ stop_hamlib ();
+ g_source_remove (tracetimer);
+- fclose (finfo.fd);
++ close(finfo.filedesc);
+ dup2 (saved_fd, STDERR_FILENO);
+ close (saved_fd);
+-#ifndef __NetBSD__
+-#ifndef G_OS_WIN32
+- stderr = fdopen (STDERR_FILENO, "w");
+-#endif
+-#endif
+ hamlibresult = start_hamlib (preferences.rigid, preferences.device,
+ RIG_DEBUG_NONE, preferences.polltime);
+ }
+@@ -180,7 +176,10 @@ on_trace_hamlib_activate(GtkMenuItem * menuitem, gpointer user_data)
+ (GTK_BOX (vbox), tracelabel, FALSE, FALSE, 0);
+ g_free (tracestr);
+ stop_hamlib();
+- finfo.fd = freopen (finfo.filename, "w", stderr);
++ finfo.filedesc = open(finfo.filename, O_WRONLY|O_CREAT, 0644);
++ if (finfo.filedesc >= 0) {
++ dup2 (finfo.filedesc, STDERR_FILENO);
++ }
+ hamlibresult = start_hamlib (preferences.rigid, preferences.device,
+ RIG_DEBUG_TRACE, preferences.polltime);
+ tracetimer = g_timeout_add
diff --git a/media-radio/xlog/xlog-2.0.24.ebuild b/media-radio/xlog/xlog-2.0.24.ebuild
index 936fb932a6cb..ea01d2109129 100644
--- a/media-radio/xlog/xlog-2.0.24.ebuild
+++ b/media-radio/xlog/xlog-2.0.24.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
@@ -30,6 +30,7 @@ DOCS=( AUTHORS data/doc/THANKS NEWS README )
src_prepare() {
eapply_user
eapply -p0 "${FILESDIR}/${PN}-2.0.7-desktop.patch"
+ eapply "${FILESDIR}/${PN}-2.0.24-musl.patch"
# Drop -Werror
sed -i -e "s:-Werror::g" configure.ac || die