diff options
author | Jakub Hrozek <jhrozek@redhat.com> | 2014-11-29 22:23:38 +0100 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2014-12-03 11:09:33 +0100 |
commit | 8e44ddfccebe61728d8a2c1dafce36dfa944bc90 (patch) | |
tree | 4416023bfd484b6a09ca04110fec2880cfd811d6 /src | |
parent | 75afab247bc9d1a27dce0b1a4b1ca6ebe106b887 (diff) | |
download | sssd-8e44ddfccebe61728d8a2c1dafce36dfa944bc90.tar.gz sssd-8e44ddfccebe61728d8a2c1dafce36dfa944bc90.tar.xz sssd-8e44ddfccebe61728d8a2c1dafce36dfa944bc90.zip |
sss_atomic_write_s() return value is signed
Reviewed-by: Sumit Bose <sbose@redhat.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/providers/ad/ad_gpo_child.c | 2 | ||||
-rw-r--r-- | src/providers/ipa/selinux_child.c | 2 | ||||
-rw-r--r-- | src/providers/krb5/krb5_child.c | 2 | ||||
-rw-r--r-- | src/providers/ldap/ldap_child.c | 2 | ||||
-rw-r--r-- | src/responder/nss/nsssrv_mmap_cache.c | 8 | ||||
-rw-r--r-- | src/tools/sss_seed.c | 2 | ||||
-rw-r--r-- | src/tools/tools_mc_util.c | 9 | ||||
-rw-r--r-- | src/util/child_common.c | 4 |
8 files changed, 15 insertions, 16 deletions
diff --git a/src/providers/ad/ad_gpo_child.c b/src/providers/ad/ad_gpo_child.c index 4bb48c047..ceb2faeb6 100644 --- a/src/providers/ad/ad_gpo_child.c +++ b/src/providers/ad/ad_gpo_child.c @@ -663,7 +663,7 @@ main(int argc, const char *argv[]) ssize_t len = 0; struct input_buffer *ibuf = NULL; struct response *resp = NULL; - size_t written; + ssize_t written; struct poptOption long_options[] = { POPT_AUTOHELP diff --git a/src/providers/ipa/selinux_child.c b/src/providers/ipa/selinux_child.c index a38ffcb26..cb6f96415 100644 --- a/src/providers/ipa/selinux_child.c +++ b/src/providers/ipa/selinux_child.c @@ -146,7 +146,7 @@ int main(int argc, const char *argv[]) ssize_t len = 0; struct input_buffer *ibuf = NULL; struct response *resp = NULL; - size_t written; + ssize_t written; struct poptOption long_options[] = { POPT_AUTOHELP diff --git a/src/providers/krb5/krb5_child.c b/src/providers/krb5/krb5_child.c index e16620891..6b722acd8 100644 --- a/src/providers/krb5/krb5_child.c +++ b/src/providers/krb5/krb5_child.c @@ -708,7 +708,7 @@ static errno_t k5c_attach_ccname_msg(struct krb5_req *kr) static errno_t k5c_send_data(struct krb5_req *kr, int fd, errno_t error) { - size_t written; + ssize_t written; uint8_t *buf; size_t len; int ret; diff --git a/src/providers/ldap/ldap_child.c b/src/providers/ldap/ldap_child.c index a1e250c46..e9aebf5a6 100644 --- a/src/providers/ldap/ldap_child.c +++ b/src/providers/ldap/ldap_child.c @@ -581,7 +581,7 @@ int main(int argc, const char *argv[]) time_t expire_time = 0; struct input_buffer *ibuf = NULL; struct response *resp = NULL; - size_t written; + ssize_t written; struct poptOption long_options[] = { POPT_AUTOHELP diff --git a/src/responder/nss/nsssrv_mmap_cache.c b/src/responder/nss/nsssrv_mmap_cache.c index 41846d565..2d159eb11 100644 --- a/src/responder/nss/nsssrv_mmap_cache.c +++ b/src/responder/nss/nsssrv_mmap_cache.c @@ -969,7 +969,7 @@ static errno_t sss_mc_set_recycled(int fd) struct sss_mc_header h; off_t offset; off_t pos; - int ret; + ssize_t written; offset = MC_PTR_DIFF(&h.status, &h); @@ -980,12 +980,12 @@ static errno_t sss_mc_set_recycled(int fd) } errno = 0; - ret = sss_atomic_write_s(fd, (uint8_t *)&w, sizeof(h.status)); - if (ret == -1) { + written = sss_atomic_write_s(fd, (uint8_t *)&w, sizeof(h.status)); + if (written == -1) { return errno; } - if (ret != sizeof(h.status)) { + if (written != sizeof(h.status)) { /* Write error */ return EIO; } diff --git a/src/tools/sss_seed.c b/src/tools/sss_seed.c index 0f8a76a61..2cd6a57aa 100644 --- a/src/tools/sss_seed.c +++ b/src/tools/sss_seed.c @@ -62,7 +62,7 @@ struct seed_ctx { static int seed_prompt(const char *req) { - size_t len = 0; + ssize_t len = 0; size_t i = 0; char *prompt = NULL; int ret = EOK; diff --git a/src/tools/tools_mc_util.c b/src/tools/tools_mc_util.c index 2d6f3fb40..9634b86e2 100644 --- a/src/tools/tools_mc_util.c +++ b/src/tools/tools_mc_util.c @@ -37,8 +37,7 @@ static errno_t sss_mc_set_recycled(int fd) struct sss_mc_header h; off_t offset; off_t pos; - int ret; - + ssize_t written; offset = MC_PTR_DIFF(&h.status, &h); @@ -49,12 +48,12 @@ static errno_t sss_mc_set_recycled(int fd) } errno = 0; - ret = sss_atomic_write_s(fd, (uint8_t *)&w, sizeof(h.status)); - if (ret == -1) { + written = sss_atomic_write_s(fd, (uint8_t *)&w, sizeof(h.status)); + if (written == -1) { return errno; } - if (ret != sizeof(h.status)) { + if (written != sizeof(h.status)) { /* Write error */ return EIO; } diff --git a/src/util/child_common.c b/src/util/child_common.c index 9710630f9..d3f488d18 100644 --- a/src/util/child_common.c +++ b/src/util/child_common.c @@ -319,7 +319,7 @@ struct write_pipe_state { int fd; uint8_t *buf; size_t len; - size_t written; + ssize_t written; }; static void write_pipe_handler(struct tevent_context *ev, @@ -384,7 +384,7 @@ static void write_pipe_handler(struct tevent_context *ev, } if (state->len != state->written) { - DEBUG(SSSDBG_CRIT_FAILURE, "Wrote %zu bytes, expected %zu\n", + DEBUG(SSSDBG_CRIT_FAILURE, "Wrote %zd bytes, expected %zu\n", state->written, state->len); tevent_req_error(req, EIO); return; |