From 056564f6af72376dba0fb616749349fc40bd1d61 Mon Sep 17 00:00:00 2001 From: Jesper Dangaard Brouer Date: Mon, 19 Jun 2006 16:53:03 +0000 Subject: [PATCH] Add new exit value to indicate concurrency issues (Jesper Dangaard Brouer ) --- include/iptables_common.h | 3 ++- iptables-standalone.c | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/include/iptables_common.h b/include/iptables_common.h index 28bda9f4..64723c3c 100644 --- a/include/iptables_common.h +++ b/include/iptables_common.h @@ -5,7 +5,8 @@ enum exittype { OTHER_PROBLEM = 1, PARAMETER_PROBLEM, - VERSION_PROBLEM + VERSION_PROBLEM, + RESOURCE_PROBLEM }; /* this is a special 64bit data type that is 8-byte aligned */ diff --git a/iptables-standalone.c b/iptables-standalone.c index 257b6777..e5c7841d 100644 --- a/iptables-standalone.c +++ b/iptables-standalone.c @@ -64,9 +64,13 @@ main(int argc, char *argv[]) if (ret) ret = iptc_commit(&handle); - if (!ret) + if (!ret) { fprintf(stderr, "iptables: %s\n", iptc_strerror(errno)); + if (errno == EAGAIN) { + exit(RESOURCE_PROBLEM); + } + } exit(!ret); } -- 2.39.5