]> git.pld-linux.org Git - packages/esound.git/blame - esound-etc_dir.patch
- release 2
[packages/esound.git] / esound-etc_dir.patch
CommitLineData
49959ad2 1diff -Nru esound-0.2.29/esd_config.c esound-0.2.29.new/esd_config.c
2--- esound-0.2.29/esd_config.c Wed Jun 19 12:14:24 2002
3+++ esound-0.2.29.new/esd_config.c Mon Mar 10 13:18:20 2003
4@@ -41,12 +41,18 @@
5 fclose(fh);
6 }
7 free(fn);
8-
9- tmpenv = getenv("HOME");
d7828c8d 10+ tmpenv = getenv("HOME_ETC");
49959ad2 11 if(tmpenv) {
12- fn = malloc(strlen(tmpenv) + sizeof("/.esd.conf"));
13- sprintf(fn, "%s/.esd.conf", tmpenv);
14-
d7828c8d
JB
15+ fn = malloc(strlen(tmpenv) + sizeof("/.esd.conf"));
16+ sprintf(fn, "%s/.esd.conf", tmpenv);
17+ } else {
49959ad2 18+ tmpenv = getenv("HOME");
19+ if(tmpenv) {
20+ fn = malloc(strlen(tmpenv) + sizeof("/.esd.conf"));
21+ sprintf(fn, "%s/.esd.conf", tmpenv);
49959ad2 22+ }
d7828c8d 23+ }
49959ad2 24+ if(tmpenv) {
25 fh = fopen(fn, "r");
26
27 if(fh)
28diff -Nru esound-0.2.29/esddsp.c esound-0.2.29.new/esddsp.c
29--- esound-0.2.29/esddsp.c Mon Aug 26 16:39:55 2002
30+++ esound-0.2.29.new/esddsp.c Mon Mar 10 12:58:56 2003
31@@ -122,6 +122,13 @@
32 {
33 use_mixer = 1;
34
d7828c8d 35+ str = getenv ("HOME_ETC");
49959ad2 36+ if (str)
37+ {
d7828c8d
JB
38+ mixer = malloc (strlen (str) + strlen (ident) + 10);
39+ sprintf (mixer, "%s/.esddsp_%s", str, ident);
49959ad2 40+ }
41+ else {
42 str = getenv ("HOME");
43 if (str)
44 {
45@@ -133,7 +140,7 @@
46 fprintf (stderr, "esddsp: can't get home directory\n");
47 exit (1);
48 }
49-
50+ }
51 DPRINTF ("mixer settings file: %s\n", mixer);
52 }
53 }
90301528
JB
54--- esound-0.2.36/esdlib.c.orig 2005-05-26 02:25:10.000000000 +0200
55+++ esound-0.2.36/esdlib.c 2005-06-11 20:40:11.772845792 +0200
56@@ -166,6 +166,7 @@
57 char *auth_filename = NULL;
49959ad2 58 unsigned char auth_key[ESD_KEY_LEN];
90301528
JB
59 const char *home = NULL;
60+ char *etc_dir = NULL;
49959ad2 61 int namelen, retval;
62 void (*phandler)(int);
63
90301528 64@@ -175,6 +176,18 @@
49959ad2 65 phandler = signal( SIGPIPE, dummy_signal ); /* for closed esd conns */
66
67 /* assemble the authorization filename */
d7828c8d 68+ etc_dir = getenv("HOME_ETC");
49959ad2 69+ if (etc_dir) {
d7828c8d 70+ namelen = strlen(etc_dir) + sizeof("/.esd_auth");
49959ad2 71+ if ((auth_filename = malloc(namelen + 1)) == 0) {
72+ fprintf( stderr, "Memory exhausted\n" );
73+ signal( SIGPIPE, phandler );
74+ return -1;
75+ }
76+
77+ strcpy( auth_filename, etc_dir );
d7828c8d 78+ strcat( auth_filename, "/.esd_auth" );
49959ad2 79+ } else {
80 home = getenv( "HOME" );
81 if ( !home ) {
82 fprintf( stderr, "HOME environment variable not set?\n" );
90301528 83@@ -191,7 +204,7 @@
49959ad2 84
85 strcpy( auth_filename, home );
86 strcat( auth_filename, "/.esd_auth" );
87-
88+ }
89 retval = 0;
90 /* open the authorization file */
91 if ( -1 == (auth_fd = open( auth_filename, O_RDONLY ) ) ) {
This page took 0.11653 seconds and 4 git commands to generate.