Guest User

Untitled

a guest
Dec 13th, 2017
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.06 KB | None | 0 0
  1. --- src/util/virrotatingfile.c.orig 2017-12-14 03:20:10.231829923 +0530
  2. +++ src/util/virrotatingfile.c 2017-12-14 03:23:53.570669831 +0530
  3. @@ -185,9 +185,15 @@
  4. virRotatingFileWriterDelete(virRotatingFileWriterPtr file)
  5. {
  6. size_t i;
  7. + char *bname = NULL;
  8.  
  9. if (unlink(file->basepath) < 0 &&
  10. errno != ENOENT && errno != EBUSY) {
  11. + bname = basename(file->basepath);
  12. +
  13. + if (!strcmp(bname, "console.log"))
  14. + return 0;
  15. +
  16. virReportSystemError(errno,
  17. _("Unable to delete file %s"),
  18. file->basepath);
  19. @@ -201,6 +207,13 @@
  20.  
  21. if (unlink(oldpath) < 0 &&
  22. errno != ENOENT && errno != EBUSY) {
  23. + bname = basename(file->basepath);
  24. +
  25. + if (!strcmp(bname, "console.log")) {
  26. + VIR_FREE(oldpath);
  27. + return 0;
  28. + }
  29. +
  30. virReportSystemError(errno,
  31. _("Unable to delete file %s"),
  32. oldpath);
Advertisement
Add Comment
Please, Sign In to add comment