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
This commit is contained in:
Warren Dukes 2004-10-31 04:34:54 +00:00
parent 38ade145bc
commit aba67249cb
2 changed files with 7 additions and 4 deletions

View File

@ -268,6 +268,9 @@ void changeToUser(Options * options) {
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
if(userpwd->pw_dir) {
setenv("HOME", userpwd->pw_dir, 1);
}
} }
} }

View File

@ -351,7 +351,7 @@ void finishVolume() {
closeAlsaMixer(); closeAlsaMixer();
break; break;
#endif #endif
#ifndef HAVE_OSS #ifdef HAVE_OSS
case VOLUME_MIXER_TYPE_OSS: case VOLUME_MIXER_TYPE_OSS:
closeOssMixer(); closeOssMixer();
break; break;
@ -370,7 +370,7 @@ void initVolume() {
volume_mixerDevice = VOLUME_MIXER_ALSA_DEFAULT; volume_mixerDevice = VOLUME_MIXER_ALSA_DEFAULT;
} }
#endif #endif
#ifndef HAVE_OSS #ifdef HAVE_OSS
else if(strcmp(param->value, VOLUME_MIXER_OSS)==0) { else if(strcmp(param->value, VOLUME_MIXER_OSS)==0) {
volume_mixerType = VOLUME_MIXER_TYPE_OSS; volume_mixerType = VOLUME_MIXER_TYPE_OSS;
volume_mixerDevice = VOLUME_MIXER_OSS_DEFAULT; volume_mixerDevice = VOLUME_MIXER_OSS_DEFAULT;
@ -411,7 +411,7 @@ int getVolumeLevel() {
case VOLUME_MIXER_TYPE_ALSA: case VOLUME_MIXER_TYPE_ALSA:
return getAlsaVolumeLevel(); return getAlsaVolumeLevel();
#endif #endif
#ifndef HAVE_OSS #ifdef HAVE_OSS
case VOLUME_MIXER_TYPE_OSS: case VOLUME_MIXER_TYPE_OSS:
return getOssVolumeLevel(); return getOssVolumeLevel();
#endif #endif
@ -448,7 +448,7 @@ int changeVolumeLevel(FILE * fp, int change, int rel) {
case VOLUME_MIXER_TYPE_ALSA: case VOLUME_MIXER_TYPE_ALSA:
return changeAlsaVolumeLevel(fp,change,rel); return changeAlsaVolumeLevel(fp,change,rel);
#endif #endif
#ifndef HAVE_OSS #ifdef HAVE_OSS
case VOLUME_MIXER_TYPE_OSS: case VOLUME_MIXER_TYPE_OSS:
return changeOssVolumeLevel(fp,change,rel); return changeOssVolumeLevel(fp,change,rel);
#endif #endif