Merge "init: Don\'t ignore setsockcreatecon errors" am: 07cb69415a
am: 17c0edc6ee
* commit '17c0edc6eea2470e628c6c209bc66f02c3ed2ec5':
init: Don't ignore setsockcreatecon errors
diff --git a/init/util.cpp b/init/util.cpp
index b316d6e..c7d0314 100644
--- a/init/util.cpp
+++ b/init/util.cpp
@@ -105,8 +105,12 @@
int fd, ret;
char *filecon;
- if (socketcon)
- setsockcreatecon(socketcon);
+ if (socketcon) {
+ if (setsockcreatecon(socketcon) == -1) {
+ ERROR("setsockcreatecon(\"%s\") failed: %s\n", socketcon, strerror(errno));
+ return -1;
+ }
+ }
fd = socket(PF_UNIX, type, 0);
if (fd < 0) {