Changeset 3289


Ignore:
Timestamp:
Jan 6, 2019, 7:03:58 AM (6 years ago)
Author:
bird
Message:

kmk/output.c: Attempts at dealing with infinite recursion occuring on tmpfile() or sync_init() failure.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified trunk/src/kmk/output.c

    r3273 r3289  
    806806
    807807  if (! tfile)
    808     pfatal_with_name ("tmpfile");
     808    {
     809#ifdef KMK
     810      if (output_context && output_context->syncout)
     811        output_context->syncout = 0; /* Avoid inifinit recursion. */
     812#endif
     813      pfatal_with_name ("tmpfile");
     814    }
    809815
    810816  /* Create a duplicate so we can close the stream.  */
    811817  fd = dup (fileno (tfile));
    812818  if (fd < 0)
    813     pfatal_with_name ("dup");
     819    {
     820#ifdef KMK
     821      if (output_context && output_context->syncout)
     822        output_context->syncout = 0; /* Avoid inifinit recursion. */
     823#endif
     824      pfatal_with_name ("dup");
     825    }
    814826
    815827  fclose (tfile);
     
    831843
    832844  if (combined_output < 0)
    833     combined_output = sync_init ();
     845    {
     846#ifdef KMK /* prevent infinite recursion if sync_init() calls perror_with_name. */
     847      combined_output = 0;
     848#endif
     849      combined_output = sync_init ();
     850    }
    834851
    835852  if (STREAM_OK (stdout))
Note: See TracChangeset for help on using the changeset viewer.