]> git.pld-linux.org Git - packages/esound.git/blob - esound-etc_dir.patch
- updated for 0.2.36
[packages/esound.git] / esound-etc_dir.patch
1 diff -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");
10 +  tmpenv = getenv("HOME_ETC");
11    if(tmpenv) {
12 -    fn = malloc(strlen(tmpenv) + sizeof("/.esd.conf"));
13 -    sprintf(fn, "%s/.esd.conf", tmpenv);
14 -
15 +    fn = malloc(strlen(tmpenv) + sizeof("/.esd.conf"));
16 +    sprintf(fn, "%s/.esd.conf", tmpenv);
17 +  } else {
18 +       tmpenv = getenv("HOME");
19 +       if(tmpenv) {
20 +       fn = malloc(strlen(tmpenv) + sizeof("/.esd.conf"));
21 +       sprintf(fn, "%s/.esd.conf", tmpenv);
22 +       }
23 +  }
24 +  if(tmpenv) { 
25      fh = fopen(fn, "r");
26  
27      if(fh)
28 diff -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  
35 +               str = getenv ("HOME_ETC");
36 +               if (str)
37 +                       {
38 +             mixer = malloc (strlen (str) + strlen (ident) + 10);
39 +             sprintf (mixer, "%s/.esddsp_%s", str, ident);
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      }
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;
58      unsigned char auth_key[ESD_KEY_LEN];
59      const char *home = NULL;
60 +    char *etc_dir = NULL;
61      int namelen, retval;
62      void (*phandler)(int);
63    
64 @@ -175,6 +176,18 @@
65      phandler = signal( SIGPIPE, dummy_signal );    /* for closed esd conns */
66    
67      /* assemble the authorization filename */
68 +               etc_dir = getenv("HOME_ETC");
69 +               if (etc_dir) {
70 +           namelen = strlen(etc_dir) + sizeof("/.esd_auth");
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 );
78 +       strcat( auth_filename, "/.esd_auth" );
79 +               } else {
80      home = getenv( "HOME" );
81      if ( !home ) {
82         fprintf( stderr, "HOME environment variable not set?\n" );
83 @@ -191,7 +204,7 @@
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.52204 seconds and 3 git commands to generate.