commit | 07cb69415a478a96c33bffc44bff49d035f51afc | [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 | ddf41f1ad0bc5fbe4a09fbcfde74492a51a705cf [diff] | |
parent | 83ccb1c76b2b88f62bfba2c58e2edd419b089756 [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) {