Add missing prototype for internal mute() function.

Fix a double free crash.

from upstream git
This commit is contained in:
dcoppa 2011-09-23 10:30:54 +00:00
parent 5b2dc50fb5
commit b8936d61bd
3 changed files with 44 additions and 1 deletions

View File

@ -1,8 +1,9 @@
# $OpenBSD: Makefile,v 1.12 2011/07/08 18:32:34 dcoppa Exp $
# $OpenBSD: Makefile,v 1.13 2011/09/23 10:30:54 dcoppa Exp $
COMMENT= console based player for last.fm radio streams
DISTNAME= shell-fm-0.8
REVISION= 0
CATEGORIES= audio
HOMEPAGE= http://nex.scrapping.cc/shell-fm/

View File

@ -0,0 +1,15 @@
$OpenBSD: patch-source_include_interface_h,v 1.1 2011/09/23 10:30:54 dcoppa Exp $
Add mute/unmute support using 'm' key
(upstream git commit c94473084607ff5761b1257fb735dd96e14bb016)
--- source/include/interface.h.orig Fri Sep 23 11:53:07 2011
+++ source/include/interface.h Fri Sep 23 11:53:39 2011
@@ -24,6 +24,7 @@ extern void quit();
extern void unlinknp();
extern void volume_up();
extern void volume_down();
+void mute();
void set_volume(int);

View File

@ -0,0 +1,27 @@
$OpenBSD: patch-source_sckif_c,v 1.1 2011/09/23 10:30:54 dcoppa Exp $
Avoid double free crash
(upstream git commit 5a43a40df8f9b000c0f8e1c1e0b40813047620b3)
--- source/sckif.c.orig Wed May 25 12:35:38 2011
+++ source/sckif.c Fri Sep 23 12:08:36 2011
@@ -33,6 +33,7 @@
#include "getln.h"
#include "tag.h"
#include "select.h"
+#include "ropen.h"
#include "util.h"
#include "globals.h"
@@ -191,10 +192,7 @@ void handle_client(int client_socket) {
if(disconnect) {
debug("removing client\n");
- shutdown(SHUT_RDWR, client_socket);
- close(client_socket);
- fclose(fd);
-
+ fshutdown(& fd);
remove_handle(client_socket);
}
}