head 1.4; access; symbols pkgsrc-2013Q2:1.4.0.54 pkgsrc-2013Q2-base:1.4 pkgsrc-2012Q4:1.4.0.52 pkgsrc-2012Q4-base:1.4 pkgsrc-2011Q4:1.4.0.50 pkgsrc-2011Q4-base:1.4 pkgsrc-2011Q2:1.4.0.48 pkgsrc-2011Q2-base:1.4 pkgsrc-2009Q4:1.4.0.46 pkgsrc-2009Q4-base:1.4 pkgsrc-2008Q4:1.4.0.44 pkgsrc-2008Q4-base:1.4 pkgsrc-2008Q3:1.4.0.42 pkgsrc-2008Q3-base:1.4 cube-native-xorg:1.4.0.40 cube-native-xorg-base:1.4 pkgsrc-2008Q2:1.4.0.38 pkgsrc-2008Q2-base:1.4 pkgsrc-2008Q1:1.4.0.36 pkgsrc-2008Q1-base:1.4 pkgsrc-2007Q4:1.4.0.34 pkgsrc-2007Q4-base:1.4 pkgsrc-2007Q3:1.4.0.32 pkgsrc-2007Q3-base:1.4 pkgsrc-2007Q2:1.4.0.30 pkgsrc-2007Q2-base:1.4 pkgsrc-2007Q1:1.4.0.28 pkgsrc-2007Q1-base:1.4 pkgsrc-2006Q4:1.4.0.26 pkgsrc-2006Q4-base:1.4 pkgsrc-2006Q3:1.4.0.24 pkgsrc-2006Q3-base:1.4 pkgsrc-2006Q2:1.4.0.22 pkgsrc-2006Q2-base:1.4 pkgsrc-2006Q1:1.4.0.20 pkgsrc-2006Q1-base:1.4 pkgsrc-2005Q4:1.4.0.18 pkgsrc-2005Q4-base:1.4 pkgsrc-2005Q3:1.4.0.16 pkgsrc-2005Q3-base:1.4 pkgsrc-2005Q2:1.4.0.14 pkgsrc-2005Q2-base:1.4 pkgsrc-2005Q1:1.4.0.12 pkgsrc-2005Q1-base:1.4 pkgsrc-2004Q4:1.4.0.10 pkgsrc-2004Q4-base:1.4 pkgsrc-2004Q3:1.4.0.8 pkgsrc-2004Q3-base:1.4 pkgsrc-2004Q2:1.4.0.6 pkgsrc-2004Q2-base:1.4 pkgsrc-2004Q1:1.4.0.4 pkgsrc-2004Q1-base:1.4 pkgsrc-2003Q4:1.4.0.2 pkgsrc-2003Q4-base:1.4 netbsd-1-6-1:1.2.0.2 netbsd-1-6-1-base:1.2 netbsd-1-6:1.1.0.4 netbsd-1-6-RELEASE-base:1.1; locks; strict; comment @# @; 1.4 date 2003.09.03.12.35.14; author martin; state dead; branches; next 1.3; 1.3 date 2003.04.17.15.09.19; author abs; state Exp; branches; next 1.2; 1.2 date 2002.10.03.15.46.58; author abs; state Exp; branches; next 1.1; 1.1 date 2002.08.02.23.01.48; author abs; state Exp; branches; next ; desc @@ 1.4 log @Update to mserv-0.35. Most previus patches have been integrated, various fixes. This version is compatible with a new nifty win32 gui client, see the homepage for links. @ text @$NetBSD: patch-ak,v 1.3 2003/04/17 15:09:19 abs Exp $ --- mserv/mserv.c.orig Sat Jul 15 18:01:15 2000 +++ mserv/mserv.c @@@@ -2098,13 +2098,13 @@@@ static t_track *mserv_loadtrk(const char } else { if (id3tag.present) { if (newinfofile) { - strncpy(author, id3tag.artist, AUTHORLEN); - author[AUTHORLEN] = '\0'; - strncpy(name, id3tag.title, NAMELEN); - name[NAMELEN] = '\0'; + strncpy(author, id3tag.artist, sizeof(id3tag.artist) - 1); + author[sizeof(id3tag.artist) - 1] = '\0'; + strncpy(name, id3tag.title, sizeof(id3tag.title) - 1); + name[sizeof(id3tag.title) - 1] = '\0'; year = atoi(id3tag.year); - strncpy(genres, id3tag.genre, GENRESLEN); - genres[GENRESLEN] = '\0'; + strncpy(genres, id3tag.genre, sizeof(id3tag.genre) - 1); + genres[sizeof(id3tag.genre) - 1] = '\0'; mserv_strtoprintable(author); mserv_strtoprintable(name); mserv_strtoprintable(genres); @@@@ -3328,8 +3328,10 @@@@ int mserv_setmixer(t_client *cl, int wha return -1; } curval = curval & 0xff; - if (!*line) + if (!*line) { + close(mixer_fd); return curval; + } if (*line == '+' || *line == '-') { type = *line == '+' ? 1 : -1; param = 1; @@@@ -3370,7 +3372,13 @@@@ int mserv_setmixer(t_client *cl, int wha mserv_response(cl, "IOCTLWR", NULL); return -1; } - newval = newval & 0xFF; + if (ioctl(mixer_fd, MIXER_READ(what), &newval) == -1) { + close(mixer_fd); + perror("iotcl read"); + mserv_response(cl, "IOCTLRD", 0); + return -1; + } + newval = newval & 0xff; if (type == 0 || newval != curval) break; param++; @ 1.3 log @Update mserv to 0.33nb6: Avoid leaking a filedescriptor when checking volume level @ text @d1 1 a1 1 $NetBSD$ @ 1.2 log @Update mserv to mserv-0.33nb5: Correctly parse ID3V2 headers. @ text @d25 13 a37 1 @@@@ -3370,7 +3370,13 @@@@ int mserv_setmixer(t_client *cl, int wha @ 1.1 log @Updated mserv to 0.33nb4: Ensure reset message is flushed before restart starts, and fix volume control to correctly report new value so 'volume -' and 'volume +' will always reduce/increase the volume by the minimum value. @ text @d3 37 a39 13 --- mserv/opt.c.orig Thu Jul 13 22:14:41 2000 +++ mserv/opt.c @@@@ -164,8 +164,8 @@@@ int opt_read(const char *root) /* special case - player variable is an indirected to another variable */ if ((val = conf_getvalue("player")) == NULL) { if (mserv_verbose) - printf("No player specified, defaulting to /usr/local/bin/mpg123\n"); - opt_player = "/usr/local/bin/mpg123"; + printf("No player specified, defaulting to " PATH_MPG123 "\n"); + opt_player = PATH_MPG123; } else { if ((opt_player = conf_getvalue(val)) == NULL) { fprintf(stderr, "%s: player setting '%s' not found\n", progname, @