Merge "init: Don\'t ignore setsockcreatecon errors"

am: 07cb69415a

* commit '07cb69415a478a96c33bffc44bff49d035f51afc':
  init: Don't ignore setsockcreatecon errors
This commit is contained in:
Nick Kralevich 2015-11-24 02:44:57 +00:00 committed by android-build-merger
commit 17c0edc6ee

View file

@ -105,8 +105,12 @@ int create_socket(const char *name, int type, mode_t perm, uid_t uid,
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) {