From: wessels <> Date: Thu, 23 Oct 1997 10:01:51 +0000 (+0000) Subject: cleanup on diskHandleWrite X-Git-Tag: SQUID_3_0_PRE1~4732 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=48cc3fcf70cd1290d8d0e0461e927351a61f80fd;p=thirdparty%2Fsquid.git cleanup on diskHandleWrite --- diff --git a/src/disk.cc b/src/disk.cc index e4a5800f3b..26be1740dd 100644 --- a/src/disk.cc +++ b/src/disk.cc @@ -1,5 +1,5 @@ /* - * $Id: disk.cc,v 1.82 1997/10/20 22:59:44 wessels Exp $ + * $Id: disk.cc,v 1.83 1997/10/23 04:01:51 wessels Exp $ * * DEBUG: section 6 Disk I/O Routines * AUTHOR: Harvest Derived @@ -360,14 +360,9 @@ file_write(int fd, FREE * free_func) { dwrite_q *wq = NULL; - fde *F; - if (fd < 0) - fatal_dump("file_write: bad FD"); - F = &fd_table[fd]; - if (!F->open) { - debug_trap("file_write: FILE_NOT_OPEN"); - return DISK_ERROR; - } + fde *F = &fd_table[fd]; + assert(fd >= 0); + assert(F->open); /* if we got here. Caller is eligible to write. */ wq = xcalloc(1, sizeof(dwrite_q)); wq->buf = ptr_to_buf; @@ -377,17 +372,15 @@ file_write(int fd, wq->free = free_func; F->disk.wrt_handle = handle; F->disk.wrt_handle_data = handle_data; - /* add to queue */ BIT_SET(F->flags, FD_WRITE_PENDING); - if (!(F->disk.write_q)) { + if (F->disk.write_q == NULL) { /* empty queue */ F->disk.write_q = F->disk.write_q_tail = wq; } else { F->disk.write_q_tail->next = wq; F->disk.write_q_tail = wq; } - if (!BIT_TEST(F->flags, FD_WRITE_DAEMON)) { #if USE_ASYNC_IO diskHandleWrite(fd, NULL);