fix for FSCORE-40

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@5566 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Michael Jerris
2007-08-03 21:29:01 +00:00
parent d3aa5b433b
commit f1222ba2fd
14 changed files with 48 additions and 30 deletions

View File

@@ -966,12 +966,16 @@ static int preprocess(const char *file, int write_fd, int rlevel)
}
}
if ((cmd = strstr(bp, "<!--#"))) {
write(write_fd, bp, (unsigned) (cmd - bp));
if ((cmd = strstr(bp, "<!--#"))) {
if(write(write_fd, bp, (unsigned) (cmd - bp)) != (cmd - bp)) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Short write!\n");
}
if ((e = strstr(cmd, "-->"))) {
*e = '\0';
e += 3;
write(write_fd, e, (unsigned) strlen(e));
e += 3;
if(write(write_fd, e, (unsigned) strlen(e)) != (int) strlen(e)) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Short write!\n");
}
} else {
ml++;
}
@@ -1027,8 +1031,11 @@ static int preprocess(const char *file, int write_fd, int rlevel)
continue;
}
write(write_fd, bp, (unsigned) cur);
if(write(write_fd, bp, (unsigned) cur) != (int) cur) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Short write!\n");
}
}
close(read_fd);