[CRIU] [PATCH 1/9] cr-errno: initial commit
Ruslan Kuprieiev
kupruser at gmail.com
Thu Dec 11 12:55:10 PST 2014
Signed-off-by: Ruslan Kuprieiev <kupruser at gmail.com>
---
Makefile.crtools | 1 +
cr-errno.c | 12 ++++++++++++
include/cr-errno.h | 7 +++++++
3 files changed, 20 insertions(+)
create mode 100644 cr-errno.c
create mode 100644 include/cr-errno.h
diff --git a/Makefile.crtools b/Makefile.crtools
index 7f21d25..9156fe5 100644
--- a/Makefile.crtools
+++ b/Makefile.crtools
@@ -69,6 +69,7 @@ endif
obj-y += cr-service.o
obj-y += sd-daemon.o
obj-y += plugin.o
+obj-y += cr-errno.o
ifneq ($(MAKECMDGOALS),clean)
incdeps := y
diff --git a/cr-errno.c b/cr-errno.c
new file mode 100644
index 0000000..b62bb54
--- /dev/null
+++ b/cr-errno.c
@@ -0,0 +1,12 @@
+static int cr_errno;
+
+int get_cr_errno(void)
+{
+ return cr_errno;
+}
+
+void set_cr_errno(int new_err)
+{
+ if (!cr_errno)
+ cr_errno = new_err;
+}
diff --git a/include/cr-errno.h b/include/cr-errno.h
new file mode 100644
index 0000000..ccea5cd
--- /dev/null
+++ b/include/cr-errno.h
@@ -0,0 +1,7 @@
+#ifndef __CR_ERRNO_H__
+#define __CR_ERRNO_H__
+
+void set_cr_errno(int err);
+int get_cr_errno(void);
+
+#endif /* __CR_ERRNO_H__ */
--
1.9.3
More information about the CRIU
mailing list