]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
cleanup on diskHandleWrite
authorwessels <>
Thu, 23 Oct 1997 10:01:51 +0000 (10:01 +0000)
committerwessels <>
Thu, 23 Oct 1997 10:01:51 +0000 (10:01 +0000)
src/disk.cc

index e4a5800f3b1afd4c96aa1569e637f8aa1e7ff8b6..26be1740dd47a1aef153ee9c273ae7cefc7191ba 100644 (file)
@@ -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);