summaryrefslogtreecommitdiff
path: root/tests/18-sim-basic_whitelist.c
diff options
context:
space:
mode:
authorPaul Moore <pmoore@redhat.com>2014-04-23 18:34:49 -0400
committerPaul Moore <pmoore@redhat.com>2014-05-01 14:15:49 -0400
commit42badbc70fc93b622b9aa2dba74f434d0334a870 (patch)
tree50886e643d3da9a73b67939d9a61845f2d5fbd45 /tests/18-sim-basic_whitelist.c
parent0fa292323f4b214a0c2f17206f183719fe382215 (diff)
downloadlibseccomp-42badbc70fc93b622b9aa2dba74f434d0334a870.tar.gz
tests: correctly return an error if seccomp_init() fails
Signed-off-by: Paul Moore <pmoore@redhat.com>
Diffstat (limited to 'tests/18-sim-basic_whitelist.c')
-rw-r--r--tests/18-sim-basic_whitelist.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/18-sim-basic_whitelist.c b/tests/18-sim-basic_whitelist.c
index d312f18..d07a3b6 100644
--- a/tests/18-sim-basic_whitelist.c
+++ b/tests/18-sim-basic_whitelist.c
@@ -19,6 +19,7 @@
* along with this library; if not, see <http://www.gnu.org/licenses>.
*/
+#include <errno.h>
#include <unistd.h>
#include <seccomp.h>
@@ -37,7 +38,7 @@ int main(int argc, char *argv[])
ctx = seccomp_init(SCMP_ACT_ALLOW);
if (ctx == NULL)
- goto out;
+ return ENOMEM;
rc = seccomp_rule_add_exact(ctx, SCMP_ACT_KILL, SCMP_SYS(read), 1,
SCMP_A0(SCMP_CMP_EQ, STDIN_FILENO));