I suspect that it is from a race condition in the checkdir function in the lines
if (stat(dir, &sbuf)) {
if (errno != ENOENT || mkdir(dir, set_dirmode) < 0) {
The errno is filled in by a stat on the directory in the prior line - if two incoming messages arrive at close to exactly the same time, it is possible that they will arrive at this point at nearly the exact same time and will both think the directory in question does not exist - when one tries to create it, it will then fail because the other one has created in the previous instant and will then ounce the message (at least under my setup). In order to prevent this, I have a patch for file.c (I also patch check1dir, just because it could happen there, too):
if (stat(dir, &sbuf)) { if (errno != ENOENT || mkdir(dir, set_dirmode) < 0) {
- sprintf(errmsg, "%s \"%s\".",
- lang[MSG_CANNOT_CREATE_DIRECTORY], dir);
- progerr(errmsg);
+ if (errno != EEXIST) { + sprintf(errmsg, "%s \"%s\".", + lang[MSG_CANNOT_CREATE_DIRECTORY], dir); + progerr(errmsg); + } return; } else if (set_showprogress) _at_@ -104,9 +106,11 @@ *p = '\0'; if (stat(dir, &sbuf)) { if (errno != ENOENT || mkdir(dir, set_dirmode) < 0) {
- sprintf(errmsg, "%s \"%s\".",
- lang[MSG_CANNOT_CREATE_DIRECTORY], dir);
- progerr(errmsg);
+ if (errno != EEXIST) { + sprintf(errmsg, "%s \"%s\".", + lang[MSG_CANNOT_CREATE_DIRECTORY], dir); + progerr(errmsg); + } return; } else if (set_showprogress)
I see this problem only rarely (every other month or so), so I can't say whether this will fix it, but I've not come up with anything better. Anyone else having this sort of trouble? Care to comment? Below is the relevant line from my config file and from my mail aliases file - if this is a terrible way to set things up, can someone let me know? Thanks in advance.
hmrc.alex
aliases file
Bill Knox Senior Operating Systems Programmer/Analyst The MITRE CorporationReceived on Thu 10 Jan 2002 07:24:12 PM GMT
This archive was generated by hypermail 2.3.0 : Sat 13 Mar 2010 03:46:12 AM GMT GMT