]> git.saurik.com Git - apple/xnu.git/blobdiff - bsd/kern/kern_aio.c
xnu-2782.20.48.tar.gz
[apple/xnu.git] / bsd / kern / kern_aio.c
index 1627d49644a996c0a15e368d64794b937c0811d0..2513122e697814570d7f1f19fafbddfa665c670f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003-2008 Apple Inc. All rights reserved.
+ * Copyright (c) 2003-2014 Apple Inc. All rights reserved.
  *
  * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
  * 
@@ -2415,8 +2415,11 @@ do_aio_write( aio_workq_entry *entryp )
                                entryp->aiocb.aio_offset,
                                flags,
                                &entryp->returnval);
-       
-       fp_drop(entryp->procp, entryp->aiocb.aio_fildes, fp, 0);
+
+       if (entryp->returnval)
+               fp_drop_written(entryp->procp, entryp->aiocb.aio_fildes, fp);
+       else
+               fp_drop(entryp->procp, entryp->aiocb.aio_fildes, fp, 0);
 
        return( error );