diff mbox

manual: nftw(); clarify FTW_SLN case

Message ID xnr32rhu1t.fsf@greed.delorie.com
State New, archived
Headers show

Commit Message

DJ Delorie Feb. 22, 2017, 1:51 a.m. UTC
Clarify that if FTW_PHYS is NOT passed, when a dangling symlink is
encountered, the callback can't use the stat info provided.

See: https://bugzilla.redhat.com/show_bug.cgi?id=1422736
diff mbox


diff --git a/manual/filesys.texi b/manual/filesys.texi
index edc7c64..c8c0425 100644
--- a/manual/filesys.texi
+++ b/manual/filesys.texi
@@ -938,7 +938,8 @@  visited and reported.  This flag is returned instead of @code{FTW_D} if
 the @code{FTW_DEPTH} flag is passed to @code{nftw} (see below).
 @item FTW_SLN
 The current item is a stale symbolic link.  The file it points to does
-not exist.
+not exist.  Note that the stat info pointed at by the second argument will
+be undefined in this case.
 @end vtable
 The last parameter of the callback function is a pointer to a structure
@@ -1087,7 +1088,9 @@  is @math{0} or a bitwise-OR combination of any of the following values.
 While traversing the directory symbolic links are not followed.  Instead
 symbolic links are reported using the @code{FTW_SL} value for the type
 parameter to the callback function.  If the file referenced by a
-symbolic link does not exist @code{FTW_SLN} is returned instead.
+symbolic link does not exist @code{FTW_SLN} is returned instead.  Note
+that if @code{FTW_PHYS} is @emph{not} passed, when @code{FTW_SLN} is
+passed to the callback, the stat data will not be defined.
 @item FTW_MOUNT
 The callback function is only called for items which are on the same
 mounted filesystem as the directory given by the @var{filename}