port gcc 4.3.x warning fixes from trunk to this branch

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.0@153743 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Kevin P. Fleming
2008-11-03 00:39:04 +00:00
parent e23be17786
commit fa635ea4b0
48 changed files with 2915 additions and 765 deletions

View File

@@ -214,7 +214,9 @@ static struct ast_str *static_callback(struct ast_tcptls_session_instance *ser,
ast_get_version(), buf, (int) st.st_size, mtype);
while ((len = read(fd, buf, sizeof(buf))) > 0)
fwrite(buf, 1, len, ser->f);
if (fwrite(buf, 1, len, ser->f) != len) {
ast_log(LOG_WARNING, "fwrite() failed: %s\n", strerror(errno));
}
close(fd);
return NULL;
@@ -525,8 +527,12 @@ static struct ast_str *handle_post(struct ast_tcptls_session_instance *ser, char
for(res = sizeof(buf);content_len;content_len -= res) {
if (content_len < res)
res = content_len;
fread(buf, 1, res, ser->f);
fwrite(buf, 1, res, f);
if (fread(buf, 1, res, ser->f) != res) {
ast_log(LOG_WARNING, "fread() failed: %s\n", strerror(errno));
}
if (fwrite(buf, 1, res, f) != res) {
ast_log(LOG_WARNING, "fwrite() failed: %s\n", strerror(errno));
}
}
if (fseek(f, SEEK_SET, 0)) {
@@ -874,8 +880,12 @@ static void *httpd_helper_thread(void *data)
if (tmp) {
fprintf(ser->f, "Content-length: %d\r\n", contentlength);
/* first write the header, then the body */
fwrite(out->str, 1, (tmp + 4 - out->str), ser->f);
fwrite(tmp + 4, 1, contentlength, ser->f);
if (fwrite(out->str, 1, (tmp + 4 - out->str), ser->f) != tmp + 4 - out->str) {
ast_log(LOG_WARNING, "fwrite() failed: %s\n", strerror(errno));
}
if (fwrite(tmp + 4, 1, contentlength, ser->f) != contentlength ) {
ast_log(LOG_WARNING, "fwrite() failed: %s\n", strerror(errno));
}
}
}
ast_free(out);