fts_children() returns NULL if there are no files. If there was a failure

then errno != 0.
This commit is contained in:
Peter Wemm 1996-09-07 19:46:29 +00:00
parent 9191680051
commit 955892a940
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=18114

View File

@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: ctm_dequeue.c,v 1.2 1996/07/12 13:12:46 gpalmer Exp $
* $Id: ctm_dequeue.c,v 1.3 1996/09/07 18:48:42 peter Exp $
*/
/*
@ -92,8 +92,11 @@ main(int argc, char **argv)
ftsent = fts_children(fts, 0);
if (ftsent == NULL)
{
err("ftschildren failed");
exit(1);
if (errno) {
err("ftschildren failed");
exit(1);
} else
exit(0);
}
/* assumption :-( */