wmacpi: fix multiple definitions of two global variables.
[dockapps.git] / wmjmail / src / Jet.stat.patch
blob4c668d7d55d026a68bed27d069a31477b75fb6ab
1 --- wmjmail.c Sat Apr 14 10:15:14 2001
2 +++ wmjmail.c.3 Sat Apr 14 10:13:35 2001
3 @@ -20,6 +20,7 @@
4 //#define APPLICATION "xterm -sb -sl 2000 +si +sk -title XTerm -fg black -bg wheat -geometry 71x50-0-0 -e mutt &"
6 int dontread = 0;
7 +static char my_cmd[350];
8 static char my_folder[256];
9 static char my_app[256];
10 static char my_audio[512];
11 @@ -62,6 +63,7 @@
15 + snprintf (my_cmd, 350, "mailchk %s", my_folder);
16 snprintf (my_audio, 511, "%s %s &", my_aplayer, my_afile);
18 set_update_delay((i) ? i : 15); /* seconds */
19 @@ -74,20 +76,19 @@
20 struct stat buf;
22 if ( stat (my_folder, &buf) != 0 ) {
23 - perror ("");
24 - fprintf (stderr, "Could not stat '%s'\n", my_folder);
25 - exit (-2);
26 + //perror ("");
27 + //fprintf (stderr, "Could not stat '%s'\n", my_folder);
28 + //exit (-2);
29 + buf.st_size = 0;
32 if ( size != buf.st_size ) {
33 - FILE *f = popen ("mailchk", "r");
34 + FILE *f = popen (my_cmd, "r");
35 fscanf (f, "%i - %i - %i", &my_new, &my_tot, &my_read);
36 pclose (f);
38 /* Do not play on startup, and only on NEW mails */
39 - if ( size != 0 &&
40 - size < buf.st_size )
41 - {
42 + if ( size != 0 && size < buf.st_size ) {
43 system (my_audio);