aboutsummaryrefslogtreecommitdiffstats
path: root/src/security.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2015-09-11 05:49:40 +0200
committerMattias Andrée <maandree@operamail.com>2015-09-11 05:49:40 +0200
commit6c9a04cf36de40da05508d42d1c78a16b62775fa (patch)
treeda66ed50aea79ba575ec1e97533379ce1fcf00b7 /src/security.c
parentm makefile (diff)
downloadcerberus-1441943433.tar.gz
cerberus-1441943433.tar.bz2
cerberus-1441943433.tar.xz
ensure all fds are closed properly + stop the user from ^c:ing the failure sleep1441943433
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to '')
-rw-r--r--src/security.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/security.c b/src/security.c
index 180e2f3..ff67d95 100644
--- a/src/security.c
+++ b/src/security.c
@@ -23,6 +23,7 @@
#include <fcntl.h>
#include <signal.h>
#include <stropts.h>
+#include <errno.h>
#if defined(OWN_VCSA) || defined(OWN_VCS)
#include <string.h>
#include <linux/vt.h>
@@ -33,6 +34,9 @@
#include "security.h"
+#define close(fd) while (((close)(fd) < 0) && (errno == EINTR))
+
+
static void fail(const char* str)
{
perror(str);