dockapps/wmjmail/src/Jet.stat.patch

46 lines
1.3 KiB
Diff
Raw Normal View History

--- wmjmail.c Sat Apr 14 10:15:14 2001
+++ wmjmail.c.3 Sat Apr 14 10:13:35 2001
@@ -20,6 +20,7 @@
//#define APPLICATION "xterm -sb -sl 2000 +si +sk -title XTerm -fg black -bg wheat -geometry 71x50-0-0 -e mutt &"
int dontread = 0;
+static char my_cmd[350];
static char my_folder[256];
static char my_app[256];
static char my_audio[512];
@@ -62,6 +63,7 @@
}
}
+ snprintf (my_cmd, 350, "mailchk %s", my_folder);
snprintf (my_audio, 511, "%s %s &", my_aplayer, my_afile);
set_update_delay((i) ? i : 15); /* seconds */
@@ -74,20 +76,19 @@
struct stat buf;
if ( stat (my_folder, &buf) != 0 ) {
- perror ("");
- fprintf (stderr, "Could not stat '%s'\n", my_folder);
- exit (-2);
+ //perror ("");
+ //fprintf (stderr, "Could not stat '%s'\n", my_folder);
+ //exit (-2);
+ buf.st_size = 0;
}
if ( size != buf.st_size ) {
- FILE *f = popen ("mailchk", "r");
+ FILE *f = popen (my_cmd, "r");
fscanf (f, "%i - %i - %i", &my_new, &my_tot, &my_read);
pclose (f);
/* Do not play on startup, and only on NEW mails */
- if ( size != 0 &&
- size < buf.st_size )
- {
+ if ( size != 0 && size < buf.st_size ) {
system (my_audio);
}