linux.patch (2154B)
1 diff --git i/Makefile w/Makefile 2 index 5a598e3..af94705 100644 3 --- i/Makefile 4 +++ w/Makefile 5 @@ -6,7 +6,7 @@ SRCS= amused.c control.c log.c xmalloc.c player.c ctl.c playlist.c \ 6 7 CPPFLAGS += -I/usr/local/include -I/usr/local/include/opus 8 9 -LDADD = -levent -lm -lsndio -lutil \ 10 +LDADD = -levent -lm -lsndio -lutil -lbsd -limsg \ 11 -L/usr/local/lib -lmpg123 -lvorbisfile -lopusfile -lFLAC 12 DPADD = ${LIBEVENT} ${LIBM} ${LIBSNDIO} ${LIBUTIL} 13 14 @@ -16,7 +16,7 @@ BINDIR ?= ${PREFIX}/bin 15 MANDIR ?= ${PREFIX}/man/man 16 .else 17 NOMAN = Yes 18 -CFLAGS += -Werror -Wall -Wstrict-prototypes -Wunused-variable 19 +CFLAGS += -Wall -Wstrict-prototypes -Wunused-variable 20 PREFIX ?= ${HOME} 21 BINDIR ?= ${PREFIX}/bin 22 BINOWN ?= ${USER} 23 diff --git i/amused.h w/amused.h 24 index 81634a0..ce89859 100644 25 --- i/amused.h 26 +++ w/amused.h 27 @@ -17,6 +17,18 @@ 28 #ifndef AMUSED_H 29 #define AMUSED_H 30 31 +#ifndef __OpenBSD__ 32 +#define pledge(a, b) (0) 33 +#endif 34 + 35 +#ifndef __dead 36 +#define __dead __attribute__((noreturn)) 37 +#endif 38 + 39 +#ifndef INFTIM 40 +#define INFTIM -1 41 +#endif 42 + 43 extern char *csock; 44 extern int debug; 45 extern int verbose; 46 diff --git i/ctl.c w/ctl.c 47 index 03560a0..e4964dc 100644 48 --- i/ctl.c 49 +++ w/ctl.c 50 @@ -824,7 +824,7 @@ ctl(int argc, char **argv) 51 ibuf = xmalloc(sizeof(*ibuf)); 52 imsg_init(ibuf, ctl_sock); 53 54 - optreset = 1; 55 + //optreset = 1; 56 optind = 1; 57 58 exit(parse(argc, argv)); 59 diff --git i/log.h w/log.h 60 index 0fa046f..c2a424d 100644 61 --- i/log.h 62 +++ w/log.h 63 @@ -21,6 +21,10 @@ 64 65 #include <stdarg.h> 66 67 +#ifndef __dead 68 +#define __dead __attribute__((noreturn)) 69 +#endif 70 + 71 void log_init(int, int); 72 void log_procinit(const char *); 73 void log_setverbose(int); 74 diff --git i/player.c w/player.c 75 index a1a9f1a..917dfe2 100644 76 --- i/player.c 77 +++ w/player.c 78 @@ -254,7 +254,7 @@ play(const void *buf, size_t len) 79 80 if (player_pfds[0].revents & (POLLHUP|POLLIN)) { 81 if (player_shouldstop()) { 82 - sio_flush(hdl); 83 + sio_stop(hdl); 84 stopped = 1; 85 return 0; 86 } 87 @@ -281,6 +281,7 @@ player(int debug, int verbose) 88 log_init(debug, LOG_DAEMON); 89 log_setverbose(verbose); 90 91 + setproctitle_init(); 92 setproctitle("player"); 93 log_procinit("player"); 94