# HG changeset patch # User Richard Mortimer # Date 1295973325 0 # Node ID ae97908485e9f29f6b47bc6716ed8f1c438a48e3 # Parent 6cc2a4cdc468189caa5ca5b0ae579b6cb039cb60 Only stat files after discounting ignored filenames. This eliminates confusing log messages similar to mlmmj-maintd.c:511: Could not stat(auser=example.com.lastmsg): No such file or directory These occur when bouncing users are unsubscribed because the .lastmsg files are checked after the auser=example.com files with no extensions. diff -r 6cc2a4cdc468 -r ae97908485e9 src/mlmmj-maintd.c --- a/src/mlmmj-maintd.c Tue Jan 25 15:21:40 2011 +0000 +++ b/src/mlmmj-maintd.c Tue Jan 25 16:35:25 2011 +0000 @@ -521,14 +521,16 @@ (strcmp(dp->d_name, ".") == 0)) continue; - if(stat(dp->d_name, &st) < 0) { - log_error(LOG_ARGS, "Could not stat(%s)", dp->d_name); + filename = mystrdup(dp->d_name); + + if((s = strstr(filename, "-probe"))) { + if(stat(filename, &st) < 0) { + log_error(LOG_ARGS, "Could not stat(%s)", + filename); + myfree(filename); continue; } - filename = mystrdup(dp->d_name); - - if((s = strstr(filename, "-probe"))) { probefd = open(filename, O_RDONLY); if(probefd < 0) continue; @@ -586,11 +588,6 @@ (strcmp(dp->d_name, ".") == 0)) continue; - if(stat(dp->d_name, &st) < 0) { - log_error(LOG_ARGS, "Could not stat(%s)", dp->d_name); - continue; - } - if(strstr(dp->d_name, "-probe")) continue; @@ -598,6 +595,11 @@ if(s && (strcmp(s, ".lastmsg") == 0)) continue; + if(stat(dp->d_name, &st) < 0) { + log_error(LOG_ARGS, "Could not stat(%s)", dp->d_name); + continue; + } + probefile = concatstr(2, dp->d_name, "-probe"); /* Skip files which already have a probe out */ @@ -675,11 +677,6 @@ (strcmp(dp->d_name, ".") == 0)) continue; - if(stat(dp->d_name, &st) < 0) { - log_error(LOG_ARGS, "Could not stat(%s)", dp->d_name); - continue; - } - if(strstr(dp->d_name, "-probe")) continue; @@ -687,6 +684,11 @@ if(a && (strcmp(a, ".lastmsg") == 0)) continue; + if(stat(dp->d_name, &st) < 0) { + log_error(LOG_ARGS, "Could not stat(%s)", dp->d_name); + continue; + } + probefile = concatstr(2, dp->d_name, "-probe"); /* Skip files which already have a probe out */