]> git.pld-linux.org Git - packages/esound.git/blob - esound-home_etc.patch
- support alsa on sparc, -devel desc cleanup, moved base docs to base
[packages/esound.git] / esound-home_etc.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("CONFIG_DIR");
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 ("CONFIG_DIR");
36 +               if (str)
37 +                       {
38 +             mixer = malloc (strlen (str) + strlen (ident) + 9);
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 diff -Nru esound-0.2.29/esdlib.c esound-0.2.29.new/esdlib.c
55 --- esound-0.2.29/esdlib.c      Mon Jul 15 09:28:26 2002
56 +++ esound-0.2.29.new/esdlib.c  Mon Mar 10 13:02:41 2003
57 @@ -159,6 +159,7 @@
58      char *auth_filename = 0;
59      unsigned char auth_key[ESD_KEY_LEN];
60      char *home = NULL;
61 +               char *config_dir = NULL;
62      int namelen, retval;
63      void (*phandler)(int);
64    
65 @@ -168,6 +169,18 @@
66      phandler = signal( SIGPIPE, dummy_signal );    /* for closed esd conns */
67    
68      /* assemble the authorization filename */
69 +               config_dir = getenv("CONFIG_DIR");
70 +               if (config_dir) {
71 +           namelen = strlen(config_dir) + sizeof("/esd_auth");
72 +         if ((auth_filename = malloc(namelen + 1)) == 0) {
73 +                               fprintf( stderr, "Memory exhausted\n" );
74 +               signal( SIGPIPE, phandler ); 
75 +                               return -1;
76 +       }
77 +
78 +       strcpy( auth_filename, config_dir );
79 +       strcat( auth_filename, "/esd_auth" );
80 +               } else {
81      home = getenv( "HOME" );
82      if ( !home ) {
83         fprintf( stderr, "HOME environment variable not set?\n" );
84 @@ -184,7 +197,7 @@
85  
86      strcpy( auth_filename, home );
87      strcat( auth_filename, "/.esd_auth" );
88 -
89 +               }
90      retval = 0;
91      /* open the authorization file */
92      if ( -1 == (auth_fd = open( auth_filename, O_RDONLY ) ) ) {
This page took 0.068157 seconds and 3 git commands to generate.