uxc: fix two minor issues reported by Coverity
[project/procd.git] / state.c
diff --git a/state.c b/state.c
index 44f56c6ea5bd533c4c1db032a330c7dbd2326785..fb81248fd7e7bc7b588a82a5e667424af188cbab 100644 (file)
--- a/state.c
+++ b/state.c
@@ -142,9 +142,12 @@ static void state_enter(void)
                set_stdio("console");
                p = getpwnam("ubus");
                if (p) {
+                       int ret;
                        LOG("- ubus -\n");
                        mkdir(p->pw_dir, 0755);
-                       chown(p->pw_dir, p->pw_uid, p->pw_gid);
+                       ret = chown(p->pw_dir, p->pw_uid, p->pw_gid);
+                       if (ret)
+                               LOG("- ubus - failed to chown(%s)\n", p->pw_dir);
                } else {
                        LOG("- ubus (running as root!) -\n");
                }