fsl.patch 1020 B

12345678910111213141516171819202122232425
  1. This patch makes sure that OSSP l2's "prefix" channel performs a single
  2. downstream write operation to make sure the leaf "file" channel has a
  3. chance to atomically write the message to the logfile. This patch is
  4. from OSSP CVS and will be included in the next OSSP l2 and OSSP fsl
  5. versions, too.
  6. Index: lib_l2/l2_ch_prefix.c
  7. ===================================================================
  8. diff -u -d -u -d -r1.23 l2_ch_prefix.c
  9. --- lib_l2/l2_ch_prefix.c 6 Jan 2003 11:41:51 -0000 1.23
  10. +++ lib_l2/l2_ch_prefix.c 10 Sep 2003 12:37:43 -0000
  11. @@ -172,10 +172,12 @@
  12. return L2_ERR_ARG;
  13. if ((n = strftime(buf2, sizeof(buf2), buf1, tm)) == 0)
  14. return L2_ERR_SYS;
  15. + n += l2_util_sprintf(buf2+n, sizeof(buf2)-n, "%s", buf);
  16. downstream = NULL;
  17. while ((rv = l2_channel_downstream(ch, &downstream)) == L2_OK)
  18. if ((rv = l2_channel_write(downstream, level, buf2, n)) != L2_OK)
  19. return rv;
  20. + return L2_OK;
  21. }
  22. return L2_OK_PASS;