Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cd67f00e authored by Elliott Hughes's avatar Elliott Hughes
Browse files

Always use strerror to report errno.

Change-Id: Icd18e4bd7dc093c18967f45b99cd451359457b03
parent bf684148
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -475,7 +475,7 @@ int do_mount_all(int nargs, char **args)
        int wp_ret = TEMP_FAILURE_RETRY(waitpid(pid, &status, 0));
        if (wp_ret < 0) {
            /* Unexpected error code. We will continue anyway. */
            NOTICE("waitpid failed rc=%d, errno=%d\n", wp_ret, errno);
            NOTICE("waitpid failed rc=%d: %s\n", wp_ret, strerror(errno));
        }

        if (WIFEXITED(status)) {
+1 −1
Original line number Diff line number Diff line
@@ -871,7 +871,7 @@ try_loading_again:
            booting = is_booting();
            goto try_loading_again;
        }
        INFO("firmware: could not open '%s' %d\n", uevent->firmware, errno);
        INFO("firmware: could not open '%s': %s\n", uevent->firmware, strerror(errno));
        write(loading_fd, "-1", 2);
        goto data_close_out;
    }
+1 −1
Original line number Diff line number Diff line
@@ -80,7 +80,7 @@ void keychord_init()

    ret = write(fd, keychords, keychords_length);
    if (ret != keychords_length) {
        ERROR("could not configure /dev/keychord %d (%d)\n", ret, errno);
        ERROR("could not configure /dev/keychord %d: %s\n", ret, strerror(errno));
        close(fd);
        fd = -1;
    }
+4 −4
Original line number Diff line number Diff line
@@ -161,7 +161,7 @@ static void write_persistent_property(const char *name, const char *value)
    snprintf(tempPath, sizeof(tempPath), "%s/.temp.XXXXXX", PERSISTENT_PROPERTY_DIR);
    fd = mkstemp(tempPath);
    if (fd < 0) {
        ERROR("Unable to write persistent property to temp file %s errno: %d\n", tempPath, errno);
        ERROR("Unable to write persistent property to temp file %s: %s\n", tempPath, strerror(errno));
        return;
    }
    write(fd, value, strlen(value));
@@ -289,15 +289,15 @@ void handle_property_set_fd()
        close(s);
        return;
    } else if (nr < 0) {
        ERROR("sys_prop: error waiting for uid=%d to send property message. err=%d %s\n", cr.uid, errno, strerror(errno));
        ERROR("sys_prop: error waiting for uid=%d to send property message: %s\n", cr.uid, strerror(errno));
        close(s);
        return;
    }

    r = TEMP_FAILURE_RETRY(recv(s, &msg, sizeof(msg), MSG_DONTWAIT));
    if(r != sizeof(prop_msg)) {
        ERROR("sys_prop: mis-match msg size received: %d expected: %zu errno: %d\n",
              r, sizeof(prop_msg), errno);
        ERROR("sys_prop: mis-match msg size received: %d expected: %zu: %s\n",
              r, sizeof(prop_msg), strerror(errno));
        close(s);
        return;
    }