diff options
Diffstat (limited to 'src/System/Torrent/Storage.hs')
-rw-r--r-- | src/System/Torrent/Storage.hs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/System/Torrent/Storage.hs b/src/System/Torrent/Storage.hs index 6dda07e1..5315d9dc 100644 --- a/src/System/Torrent/Storage.hs +++ b/src/System/Torrent/Storage.hs | |||
@@ -90,7 +90,9 @@ data Storage = Storage | |||
90 | -- * when seeding, validation 'ReadOnly' mode. | 90 | -- * when seeding, validation 'ReadOnly' mode. |
91 | -- | 91 | -- |
92 | open :: Mode -> PieceSize -> FileLayout FileSize -> IO Storage | 92 | open :: Mode -> PieceSize -> FileLayout FileSize -> IO Storage |
93 | open mode s l = Storage mode s <$> mmapFiles mode l | 93 | open mode s l |
94 | | s <= 0 = throwIO (InvalidSize s) | ||
95 | | otherwise = Storage mode s <$> mmapFiles mode l | ||
94 | 96 | ||
95 | -- | Unmaps all files forcefully. It is recommended but not required. | 97 | -- | Unmaps all files forcefully. It is recommended but not required. |
96 | close :: Storage -> IO () | 98 | close :: Storage -> IO () |