-/* $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"
/* 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);
}
/* 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;
}
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 */
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;
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;
}
}
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;
}
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. */
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,
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);