Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Move salient information from readlink() comment to wrapReadLink

darcs-hash:20080317145454-4210b-4963958cc352d1aaca11d2d6e31c6849857b7414.gz
  • Loading branch information...
commit 512b24cac88c06e0ca9f16eb6b30b529acf532f7 1 parent a410468
Will Thompson wjt authored

Showing 1 changed file with 2 additions and 6 deletions. Show diff stats Hide diff stats

  1. +2 6 HFuse.hsc
8 HFuse.hsc
@@ -139,12 +139,6 @@ fileStatToCStat stat pStat = do
139 139 (#poke struct stat, st_ctime) pStat (statStatusChangeTime stat)
140 140
141 141
142   -{- readlink() should fill the buffer with a null terminated string. The
143   - buffer size argument includes the space for the terminating null
144   - character. If the linkname is too long to fit in the buffer, it should
145   - be truncated. The return value should be 0 for success.
146   --}
147   -
148 142 -- | The Unix type of a node in the filesystem.
149 143 data EntryType
150 144 = Unknown -- ^ Unknown entry type
@@ -542,6 +536,8 @@ fuseMain ops handler =
542 536 case eitherTarget of
543 537 Left (Errno errno) -> return (- errno)
544 538 Right target ->
  539 + -- This will truncate target if it's longer than the buffer
  540 + -- can hold, which is correct according to fuse.h
545 541 do pokeCStringLen0 (pBuf, (fromIntegral bufSize)) target
546 542 return okErrno
547 543

0 comments on commit 512b24c

Please sign in to comment.
Something went wrong with that request. Please try again.