system/stackmonitor/: Minor design improvement.
This commit is contained in:
parent
8830a841b4
commit
84ceda663d
@ -378,14 +378,9 @@ static int stackmonitor_daemon(int argc, char **argv)
|
|||||||
* directories with (2) all numeric names.
|
* directories with (2) all numeric names.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (!DIRENT_ISDIRECTORY(entryp->d_type) ||
|
if (DIRENT_ISDIRECTORY(entryp->d_type) &&
|
||||||
!stackmonitor_check_name(entryp->d_name))
|
stackmonitor_check_name(entryp->d_name))
|
||||||
{
|
{
|
||||||
/* Not a directory or not a numeric PID directory ... skip this entry */
|
|
||||||
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Looks good -- process the directory */
|
/* Looks good -- process the directory */
|
||||||
|
|
||||||
ret = stkmon_process_directory(entryp);
|
ret = stkmon_process_directory(entryp);
|
||||||
@ -393,7 +388,8 @@ static int stackmonitor_daemon(int argc, char **argv)
|
|||||||
{
|
{
|
||||||
/* Failed to process the thread directory */
|
/* Failed to process the thread directory */
|
||||||
|
|
||||||
fprintf(stderr, "Stack Monitor: Failed to process sub-directory: %s\n",
|
fprintf(stderr,
|
||||||
|
"Stack Monitor: Failed to process sub-directory: %s\n",
|
||||||
entryp->d_name);
|
entryp->d_name);
|
||||||
|
|
||||||
if (++errcount > 100)
|
if (++errcount > 100)
|
||||||
@ -404,6 +400,7 @@ static int stackmonitor_daemon(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
closedir(dirp);
|
closedir(dirp);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user