commit | 23202e62f142c6cdee34f998d38817f6859d25f7 | [log] [tgz] |
---|---|---|
author | Nick Kralevich <nnk@google.com> | Tue Nov 24 01:18:12 2015 +0000 |
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | Tue Nov 24 01:18:12 2015 +0000 |
tree | 5993a50648c30b58087c38f3ffaa0e49019cdca8 | |
parent | f201ffde5a6dcc975c4cb46ecd59bd69386d3917 [diff] | |
parent | beaa7efca1b642cec9aec99a4cf67d5d0ec0a2cb [diff] |
Merge "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) {