From patchwork Wed Feb 22 01:51:26 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: DJ Delorie X-Patchwork-Id: 19326 Received: (qmail 33150 invoked by alias); 22 Feb 2017 01:51:31 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 33141 invoked by uid 89); 22 Feb 2017 01:51:30 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=H*r:8.14.7 X-HELO: mx1.redhat.com Date: Tue, 21 Feb 2017 20:51:26 -0500 Message-Id: From: DJ Delorie To: libc-alpha@sourceware.org CC: codonell@redhat.com Subject: [patch] manual: nftw(); clarify FTW_SLN case 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 --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}