From aba67249cb595187667c3207ee42daa260c53791 Mon Sep 17 00:00:00 2001 From: Warren Dukes Date: Sun, 31 Oct 2004 04:34:54 +0000 Subject: if a home directory is available for 'user', set env variable $HOME git-svn-id: https://svn.musicpd.org/mpd/trunk@2426 09075e82-0dd4-0310-85a5-a0d7c8717e4f --- src/main.c | 3 +++ src/volume.c | 8 ++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/main.c b/src/main.c index d4732f046..15cc27e01 100644 --- a/src/main.c +++ b/src/main.c @@ -268,6 +268,9 @@ void changeToUser(Options * options) { exit(EXIT_FAILURE); } + if(userpwd->pw_dir) { + setenv("HOME", userpwd->pw_dir, 1); + } } } diff --git a/src/volume.c b/src/volume.c index 14733ae0b..f97ee2d1b 100644 --- a/src/volume.c +++ b/src/volume.c @@ -351,7 +351,7 @@ void finishVolume() { closeAlsaMixer(); break; #endif -#ifndef HAVE_OSS +#ifdef HAVE_OSS case VOLUME_MIXER_TYPE_OSS: closeOssMixer(); break; @@ -370,7 +370,7 @@ void initVolume() { volume_mixerDevice = VOLUME_MIXER_ALSA_DEFAULT; } #endif -#ifndef HAVE_OSS +#ifdef HAVE_OSS else if(strcmp(param->value, VOLUME_MIXER_OSS)==0) { volume_mixerType = VOLUME_MIXER_TYPE_OSS; volume_mixerDevice = VOLUME_MIXER_OSS_DEFAULT; @@ -411,7 +411,7 @@ int getVolumeLevel() { case VOLUME_MIXER_TYPE_ALSA: return getAlsaVolumeLevel(); #endif -#ifndef HAVE_OSS +#ifdef HAVE_OSS case VOLUME_MIXER_TYPE_OSS: return getOssVolumeLevel(); #endif @@ -448,7 +448,7 @@ int changeVolumeLevel(FILE * fp, int change, int rel) { case VOLUME_MIXER_TYPE_ALSA: return changeAlsaVolumeLevel(fp,change,rel); #endif -#ifndef HAVE_OSS +#ifdef HAVE_OSS case VOLUME_MIXER_TYPE_OSS: return changeOssVolumeLevel(fp,change,rel); #endif -- cgit v1.2.3