commit | f091dfe01079293c0a98afd4fe6d5df7bfd85c7f | [log] [tgz] |
---|---|---|
author | Chih-hung Hsieh <chh@google.com> | Tue Nov 24 17:08:20 2015 +0000 |
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | Tue Nov 24 17:08:20 2015 +0000 |
tree | 26cc3efc0f61b9bfbc76c49a61c71f10969b74ab | |
parent | 07cb69415a478a96c33bffc44bff49d035f51afc [diff] | |
parent | 2858ba18e70935c25a44ff893aa91dcace320554 [diff] |
Merge "Add explicit cast to shut off clang warnings."
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) {