Simplifies the WIN32 porting.
/*
- * $Id: store_dir_aufs.cc,v 1.45 2002/05/19 16:40:56 hno Exp $
+ * $Id: store_dir_aufs.cc,v 1.46 2002/06/26 09:55:57 hno Exp $
*
* DEBUG: section 47 Store Directory Routines
* AUTHOR: Duane Wessels
rb->sd->path, rb->counts.scancount);
debug(20, 9) ("file_in: fd=%d %08X\n", fd, filn);
statCounter.syscalls.disk.reads++;
- if (read(fd, hdr_buf, SM_PAGE_SIZE) < 0) {
+ if (FD_READ_METHOD(fd, hdr_buf, SM_PAGE_SIZE) < 0) {
debug(20, 1) ("storeAufsDirRebuildFromDirectory: read(FD %d): %s\n",
fd, xstrerror());
file_close(fd);
state->outbuf_offset += ss;
/* buffered write */
if (state->outbuf_offset + ss > CLEAN_BUF_SZ) {
- if (write(state->fd, state->outbuf, state->outbuf_offset) < 0) {
+ if (FD_WRITE_METHOD(state->fd, state->outbuf, state->outbuf_offset) < 0) {
debug(50, 0) ("storeDirWriteCleanLogs: %s: write: %s\n",
state->new, xstrerror());
debug(20, 0) ("storeDirWriteCleanLogs: Current swap logfile not replaced.\n");
if (state->fd < 0)
return;
state->walker->Done(state->walker);
- if (write(state->fd, state->outbuf, state->outbuf_offset) < 0) {
+ if (FD_WRITE_METHOD(state->fd, state->outbuf, state->outbuf_offset) < 0) {
debug(50, 0) ("storeDirWriteCleanLogs: %s: write: %s\n",
state->new, xstrerror());
debug(20, 0) ("storeDirWriteCleanLogs: Current swap logfile "
/*
- * $Id: store_dir_coss.cc,v 1.34 2002/05/19 16:40:57 hno Exp $
+ * $Id: store_dir_coss.cc,v 1.35 2002/06/26 09:55:57 hno Exp $
*
* DEBUG: section 81 Store COSS Directory Routines
* AUTHOR: Eric Stern
state->outbuf_offset += ss;
/* buffered write */
if (state->outbuf_offset + ss > CLEAN_BUF_SZ) {
- if (write(state->fd, state->outbuf, state->outbuf_offset) < 0) {
+ if (FD_WRITE_METHOD(state->fd, state->outbuf, state->outbuf_offset) < 0) {
debug(50, 0) ("storeCossDirWriteCleanLogs: %s: write: %s\n",
state->new, xstrerror());
debug(20, 0) ("storeCossDirWriteCleanLogs: Current swap logfile not replaced.\n");
return;
if (state->fd < 0)
return;
- if (write(state->fd, state->outbuf, state->outbuf_offset) < 0) {
+ if (FD_WRITE_METHOD(state->fd, state->outbuf, state->outbuf_offset) < 0) {
debug(50, 0) ("storeCossDirWriteCleanLogs: %s: write: %s\n",
state->new, xstrerror());
debug(20, 0) ("storeCossDirWriteCleanLogs: Current swap logfile "
/*
- * $Id: store_io_coss.cc,v 1.14 2002/04/13 23:07:56 hno Exp $
+ * $Id: store_io_coss.cc,v 1.15 2002/06/26 09:55:57 hno Exp $
*
* DEBUG: section 81 Storage Manager COSS Interface
* AUTHOR: Eric Stern
sleep(5); /* XXX EEEWWW! */
lseek(cs->fd, t->diskstart, SEEK_SET);
end = (t == cs->current_membuf) ? cs->current_offset : t->diskend;
- write(cs->fd, t->buffer, end - t->diskstart);
+ FD_WRITE_METHOD(cs->fd, t->buffer, end - t->diskstart);
}
}
/*
- * $Id: store_dir_diskd.cc,v 1.66 2002/05/19 16:40:59 hno Exp $
+ * $Id: store_dir_diskd.cc,v 1.67 2002/06/26 09:55:58 hno Exp $
*
* DEBUG: section 47 Store Directory Routines
* AUTHOR: Duane Wessels
rb->sd->path, rb->counts.scancount);
debug(20, 9) ("file_in: fd=%d %08X\n", fd, filn);
statCounter.syscalls.disk.reads++;
- if (read(fd, hdr_buf, SM_PAGE_SIZE) < 0) {
+ if (FD_READ_METHOD(fd, hdr_buf, SM_PAGE_SIZE) < 0) {
debug(20, 1) ("storeDiskdDirRebuildFromDirectory: read(FD %d): %s\n",
fd, xstrerror());
file_close(fd);
state->outbuf_offset += ss;
/* buffered write */
if (state->outbuf_offset + ss > CLEAN_BUF_SZ) {
- if (write(state->fd, state->outbuf, state->outbuf_offset) < 0) {
+ if (FD_WRITE_METHOD(state->fd, state->outbuf, state->outbuf_offset) < 0) {
debug(50, 0) ("storeDirWriteCleanLogs: %s: write: %s\n",
state->new, xstrerror());
debug(20, 0) ("storeDirWriteCleanLogs: Current swap logfile not replaced.\n");
if (state->fd < 0)
return;
state->walker->Done(state->walker);
- if (write(state->fd, state->outbuf, state->outbuf_offset) < 0) {
+ if (FD_WRITE_METHOD(state->fd, state->outbuf, state->outbuf_offset) < 0) {
debug(50, 0) ("storeDirWriteCleanLogs: %s: write: %s\n",
state->new, xstrerror());
debug(20, 0) ("storeDirWriteCleanLogs: Current swap logfile "
/*
- * $Id: store_dir_ufs.cc,v 1.44 2002/05/19 16:41:01 hno Exp $
+ * $Id: store_dir_ufs.cc,v 1.45 2002/06/26 09:55:59 hno Exp $
*
* DEBUG: section 47 Store Directory Routines
* AUTHOR: Duane Wessels
rb->sd->path, rb->counts.scancount);
debug(20, 9) ("file_in: fd=%d %08X\n", fd, filn);
statCounter.syscalls.disk.reads++;
- if (read(fd, hdr_buf, SM_PAGE_SIZE) < 0) {
+ if (FD_READ_METHOD(fd, hdr_buf, SM_PAGE_SIZE) < 0) {
debug(20, 1) ("storeUfsDirRebuildFromDirectory: read(FD %d): %s\n",
fd, xstrerror());
file_close(fd);
state->outbuf_offset += ss;
/* buffered write */
if (state->outbuf_offset + ss > CLEAN_BUF_SZ) {
- if (write(state->fd, state->outbuf, state->outbuf_offset) < 0) {
+ if (FD_WRITE_METHOD(state->fd, state->outbuf, state->outbuf_offset) < 0) {
debug(50, 0) ("storeDirWriteCleanLogs: %s: write: %s\n",
state->new, xstrerror());
debug(20, 0) ("storeDirWriteCleanLogs: Current swap logfile not replaced.\n");
if (state->fd < 0)
return;
state->walker->Done(state->walker);
- if (write(state->fd, state->outbuf, state->outbuf_offset) < 0) {
+ if (FD_WRITE_METHOD(state->fd, state->outbuf, state->outbuf_offset) < 0) {
debug(50, 0) ("storeDirWriteCleanLogs: %s: write: %s\n",
state->new, xstrerror());
debug(20, 0) ("storeDirWriteCleanLogs: Current swap logfile "
/*
- * $Id: logfile.cc,v 1.10 2002/04/06 20:48:44 hno Exp $
+ * $Id: logfile.cc,v 1.11 2002/06/26 09:55:56 hno Exp $
*
* DEBUG: section 50 Log file handling
* AUTHOR: Duane Wessels
logfileWriteWrapper(Logfile * lf, const void *buf, size_t len)
{
int s;
- s = write(lf->fd, buf, len);
+ s = FD_WRITE_METHOD(lf->fd, buf, len);
fd_bytes(lf->fd, s, FD_WRITE);
if (s == len)
return;
/*
- * $Id: net_db.cc,v 1.161 2002/04/17 21:53:26 hno Exp $
+ * $Id: net_db.cc,v 1.162 2002/06/26 09:55:56 hno Exp $
*
* DEBUG: section 38 Network Measurement Database
* AUTHOR: Duane Wessels
return;
}
t = buf = xcalloc(1, sb.st_size + 1);
- l = read(fd, buf, sb.st_size);
+ l = FD_READ_METHOD(fd, buf, sb.st_size);
file_close(fd);
if (l <= 0)
return;