Skip to content

Commit

Permalink
Move context definition into higher scopes
Browse files Browse the repository at this point in the history
The functions include additional calls to IO code that takes a
context arg under PERL_IMPLICIT_CONTEXT.  These probably slipped
through because they are only compiled when HAS_ZLIB is true.
  • Loading branch information
jandubois committed Jun 2, 2015
1 parent 5e62002 commit da67f32
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions FileHandle.xs
Expand Up @@ -240,6 +240,7 @@ NYTP_open(const char *name, const char *mode) {

static void
grab_input(NYTP_file ifile) {
dNFTHX(ifile);
ERRNO_PROBE;

ifile->count = 0;
Expand All @@ -260,7 +261,6 @@ grab_input(NYTP_file ifile) {
if (got == 0) {
if (!feof(ifile->file)) {
int eno = errno;
dNFTHX(ifile);
croak("grab_input failed: %d (%s)", eno, strerror(eno));
}
ifile->stdio_at_eof = TRUE;
Expand Down Expand Up @@ -443,6 +443,7 @@ NYTP_gets(NYTP_file ifile, char **buffer_p, size_t *len_p) {
(and hopefully the underlying OS block writes). */
static void
sync_avail_out_to_ftell(NYTP_file ofile) {
dNFTHX(ofile);
const long result = ftell(ofile->file);
const unsigned long where = result < 0 ? 0 : result;
ERRNO_PROBE;
Expand All @@ -457,6 +458,7 @@ sync_avail_out_to_ftell(NYTP_file ofile) {
/* flush has values as described for "allowed flush values" in zlib.h */
static void
flush_output(NYTP_file ofile, int flush) {
dNFTHX(ofile);
ERRNO_PROBE;

ofile->zs.next_in = (Bytef *) ofile->large_buffer;
Expand Down Expand Up @@ -502,7 +504,6 @@ flush_output(NYTP_file ofile, int flush) {
avail -= count;
} else {
int eno = errno;
dNFTHX(ofile);
croak("fwrite in flush error %d: %s", eno,
strerror(eno));
}
Expand Down

0 comments on commit da67f32

Please sign in to comment.