]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
assign disk.c to debugging section 6
authorwessels <>
Sat, 30 Mar 1996 04:16:08 +0000 (04:16 +0000)
committerwessels <>
Sat, 30 Mar 1996 04:16:08 +0000 (04:16 +0000)
src/disk.cc

index 4ae1476803c3d80a4e3c9c9954e270b444e3cd84..16690a9a547648b3b1ce782e5399d845ce12d0d0 100644 (file)
@@ -1,4 +1,6 @@
-/* $Id: disk.cc,v 1.6 1996/03/28 05:21:46 wessels Exp $ */
+/* $Id: disk.cc,v 1.7 1996/03/29 21:16:08 wessels Exp $ */
+
+/* DEBUG: Section 6             disk: disk I/O routines */
 
 #include "squid.h"
 
@@ -111,7 +113,7 @@ int file_open(path, handler, mode)
 
     /* Open file */
     if ((fd = open(path, mode | O_NDELAY, 0644)) < 0) {
-       debug(0, 0, "file_open: error opening file %s: %s\n",
+       debug(6, 0, "file_open: error opening file %s: %s\n",
            path, xstrerror());
        return (DISK_ERROR);
     }
@@ -138,13 +140,13 @@ int file_open(path, handler, mode)
     /* set non-blocking mode */
 #if defined(O_NONBLOCK) && !defined(_SQUID_SUNOS_) && !defined(_SQUID_SOLARIS_)
     if (fcntl(fd, F_SETFL, O_NONBLOCK) < 0) {
-       debug(0, 0, "file_open: FD %d: Failure to set O_NONBLOCK: %s\n",
+       debug(6, 0, "file_open: FD %d: Failure to set O_NONBLOCK: %s\n",
            fd, xstrerror());
        return DISK_ERROR;
     }
 #else
     if (fcntl(fd, F_SETFL, O_NDELAY) < 0) {
-       debug(0, 0, "file_open: FD %d: Failure to set O_NDELAY: %s\n",
+       debug(6, 0, "file_open: FD %d: Failure to set O_NDELAY: %s\n",
            fd, xstrerror());
        return DISK_ERROR;
     }
@@ -209,7 +211,7 @@ int file_close(fd)
        file_table[fd].filename[0] = '\0';
 
        if (fdstat_type(fd) == Socket) {
-           debug(0, 0, "FD %d: Someone called file_close() on a socket\n", fd);
+           debug(6, 0, "FD %d: Someone called file_close() on a socket\n", fd);
            fatal_dump(NULL);
        }
        /* update fdstat */
@@ -249,7 +251,7 @@ int file_write_lock(fd)
      int fd;
 {
     if (file_table[fd].write_lock == LOCK) {
-       debug(0, 0, "trying to lock a locked file\n");
+       debug(6, 0, "trying to lock a locked file\n");
        return DISK_WRT_LOCK_FAIL;
     } else {
        file_table[fd].write_lock = LOCK;
@@ -269,7 +271,7 @@ int file_write_unlock(fd, access_code)
        file_table[fd].write_lock = UNLOCK;
        return DISK_OK;
     } else {
-       debug(0, 0, "trying to unlock the file with the wrong access code\n");
+       debug(6, 0, "trying to unlock the file with the wrong access code\n");
        return DISK_WRT_WRONG_CODE;
     }
 }
@@ -308,7 +310,7 @@ int diskHandleWrite(fd, entry)
                return DISK_OK;
            default:
                /* disk i/o failure--flushing all outstanding writes  */
-               debug(0, 1, "diskHandleWrite: disk write error %s\n",
+               debug(6, 1, "diskHandleWrite: disk write error %s\n",
                    xstrerror());
                entry->write_daemon = NOT_PRESENT;
                entry->write_pending = NO_WRT_PENDING;
@@ -404,7 +406,7 @@ int file_write(fd, ptr_to_buf, len, access_code, handle, handle_data)
     }
     if ((file_table[fd].write_lock == LOCK) &&
        (file_table[fd].access_code != access_code)) {
-       debug(0, 0, "file write: access code checked failed. Sync problem.\n");
+       debug(6, 0, "file write: access code checked failed. Sync problem.\n");
        return DISK_WRT_WRONG_CODE;
     }
     /* if we got here. Caller is eligible to write. */
@@ -460,7 +462,7 @@ int diskHandleRead(fd, ctrl_dat)
        case EWOULDBLOCK:
            break;
        default:
-           debug(0, 1, "diskHandleRead: FD %d: error reading: %s\n",
+           debug(6, 1, "diskHandleRead: FD %d: error reading: %s\n",
                fd, xstrerror());
            ctrl_dat->handler(fd, ctrl_dat->buf,
                ctrl_dat->cur_len, DISK_ERROR,
@@ -550,7 +552,7 @@ int diskHandleWalk(fd, walk_dat)
        case EWOULDBLOCK:
            break;
        default:
-           debug(0, 1, "diskHandleWalk: FD %d: error readingd: %s\n",
+           debug(6, 1, "diskHandleWalk: FD %d: error readingd: %s\n",
                fd, xstrerror());
            walk_dat->handler(fd, DISK_ERROR, walk_dat->client_data);
            safe_free(walk_dat->buf);