... if the error is ENOENT. This merely means we were too slow and that
we can safely ignore the process.
if ((pid < 1) || (NULL == buf) || (buf_len < 2))
return NULL;
if ((pid < 1) || (NULL == buf) || (buf_len < 2))
return NULL;
- ssnprintf (file, sizeof (file), "/proc/%u/cmdline", pid);
+ ssnprintf (file, sizeof (file), "/proc/%u/cmdline",
+ (unsigned int) pid);
fd = open (file, O_RDONLY);
if (fd < 0) {
char errbuf[4096];
fd = open (file, O_RDONLY);
if (fd < 0) {
char errbuf[4096];
- WARNING ("processes plugin: Failed to open `%s': %s.", file,
- sstrerror (errno, errbuf, sizeof (errbuf)));
+ /* ENOENT means the process exited while we were handling it.
+ * Don't complain about this, it only fills the logs. */
+ if (errno != ENOENT)
+ WARNING ("processes plugin: Failed to open `%s': %s.", file,
+ sstrerror (errno, errbuf, sizeof (errbuf)));
status = read (fd, (void *)buf_ptr, len);
if (status < 0) {
status = read (fd, (void *)buf_ptr, len);
if (status < 0) {
if ((EAGAIN == errno) || (EINTR == errno))
continue;
if ((EAGAIN == errno) || (EINTR == errno))
continue;