From fa40a15f904251cdbbd141a3c7d00fe8a0c919e3 Mon Sep 17 00:00:00 2001 From: Dagobert Michelsen Date: Thu, 28 May 2015 13:24:41 +0200 Subject: [PATCH] No busy looping around open() --- src/zone.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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) { -- 2.30.2