mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-06 21:09:47 +00:00
Solaris fixes.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@289581 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -788,7 +788,7 @@ static int file_write(struct ast_channel *chan, const char *cmd, char *data, con
|
||||
fseeko(ff, offset, SEEK_SET);
|
||||
|
||||
ast_debug(3, "offset=%s/%" PRId64 ", length=%s/%" PRId64 ", vlength=%" PRId64 ", flength=%" PRId64 "\n",
|
||||
args.offset, offset, args.length, length, vlength, flength);
|
||||
S_OR(args.offset, "(null)"), offset, S_OR(args.length, "(null)"), length, vlength, flength);
|
||||
|
||||
if (length == vlength) {
|
||||
/* Simplest case, a straight replace */
|
||||
@@ -821,6 +821,11 @@ static int file_write(struct ast_channel *chan, const char *cmd, char *data, con
|
||||
if (fwrite(fbuf, 1, sizeof(fbuf), ff) < sizeof(fbuf)) {
|
||||
ast_log(LOG_ERROR, "Short write?!!\n");
|
||||
}
|
||||
/* Seek to where we stopped reading */
|
||||
if (fseeko(ff, cur + sizeof(fbuf), SEEK_SET) < 0) {
|
||||
/* Only reason for seek to fail is EOF */
|
||||
break;
|
||||
}
|
||||
}
|
||||
fclose(ff);
|
||||
if (truncate(args.filename, flength - (length - vlength))) {
|
||||
|
Reference in New Issue
Block a user