From: Dagobert Michelsen Date: Thu, 28 May 2015 11:24:41 +0000 (+0200) Subject: No busy looping around open() X-Git-Tag: collectd-5.6.0~709^2~2 X-Git-Url: https://git.octo.it/?p=collectd.git;a=commitdiff_plain;h=fa40a15f904251cdbbd141a3c7d00fe8a0c919e3 No busy looping around open() --- diff --git a/src/zone.c b/src/zone.c index 385e5116..78e91ef2 100644 --- a/src/zone.c +++ b/src/zone.c @@ -65,10 +65,8 @@ zone_read_procfile(char *pidstr, char *file, void *buf, size_t bufsize) char procfile[MAX_PROCFS_PATH]; (void)snprintf(procfile, sizeof(procfile), "/proc/%s/%s", pidstr, file); - while ((fd = open(procfile, O_RDONLY)) == -1) { - if ((errno != EMFILE) || (errno != ENFILE)) { - return(1); - } + if ((fd = open(procfile, O_RDONLY)) == -1) { + return (1); } if (pread(fd, buf, bufsize, 0) != bufsize) {