Ticket #6359: disk-full.diff

File disk-full.diff, 2.6 KB (added by jorcas33@…, 15 years ago)

patch from svn diff (release 20211)

  • libs/libmythtv/ThreadedFileWriter.cpp

     
    6868                VERBOSE(VB_IMPORTANT, LOC + "safe_write(): Got EAGAIN.");
    6969                continue;
    7070            }
    71 
     71            if (errno == ENOSPC)
     72            {
     73                VERBOSE(VB_IMPORTANT, LOC + "safe_write(): Got ENOSPC (No space left on device).");
     74                errcnt = 10;
     75                tot = 0;
     76                break;
     77            }
    7278            errcnt++;
    7379            VERBOSE(VB_IMPORTANT, LOC_ERR + "safe_write(): File I/O " +
    74                     QString(" errcnt: %1").arg(errcnt) + ENO);
     80                    QString(" errcnt: %1").arg(errcnt) + ENO + QString(" errno: %1").arg(errno));
    7581
    7682            if (errcnt == 3)
    7783                break;
     
    389395            size = safe_write(fd, buf+rpos, size, write_ok);
    390396        }
    391397
    392 
    393         if (!ignore_writes && !write_ok && (EFBIG == errno))
     398        if (!ignore_writes && !write_ok && ((EFBIG == errno) || (ENOSPC == errno)))
    394399        {
    395             QString msg =
    396                 "Maximum file size exceeded by '%1'"
    397                 "\n\t\t\t"
    398                 "You must either change the process ulimits, configure"
    399                 "\n\t\t\t"
    400                 "your operating system with \"Large File\" support, or use"
    401                 "\n\t\t\t"
    402                 "a filesystem which supports 64-bit or 128-bit files."
    403                 "\n\t\t\t"
    404                 "HINT: FAT32 is a 32-bit filesystem.";
     400            QString msg;
     401            switch (errno)
     402            {
     403                case EFBIG:
     404                    msg =
     405                        "Maximum file size exceeded by '%1'"
     406                        "\n\t\t\t"
     407                        "You must either change the process ulimits, configure"
     408                        "\n\t\t\t"
     409                        "your operating system with \"Large File\" support, or use"
     410                        "\n\t\t\t"
     411                        "a filesystem which supports 64-bit or 128-bit files."
     412                        "\n\t\t\t"
     413                        "HINT: FAT32 is a 32-bit filesystem.";
     414                    break;
     415                case ENOSPC:
     416                    msg =
     417                        "No space left on the device for file '%1'"
     418                        "\n\t\t\t"
     419                        "file will be truncate, no further write will be done.";
     420                    break;
     421            }
    405422
    406423            VERBOSE(VB_IMPORTANT, msg.arg(filename));
    407424            ignore_writes = true;