(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;
- }
-
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;
+ }
+
probefd = open(filename, O_RDONLY);
if(probefd < 0)
continue;
(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;
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 */
(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;
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 */