From bacc5d7610cd5743f3d2f2a6e8bb518b681d1956 Mon Sep 17 00:00:00 2001 From: peter Date: Sat, 7 Sep 1996 19:46:29 +0000 Subject: [PATCH] fts_children() returns NULL if there are no files. If there was a failure then errno != 0. --- usr.sbin/ctm/ctm_dequeue/ctm_dequeue.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/usr.sbin/ctm/ctm_dequeue/ctm_dequeue.c b/usr.sbin/ctm/ctm_dequeue/ctm_dequeue.c index 7e5904554ea8..343bd4be2353 100644 --- a/usr.sbin/ctm/ctm_dequeue/ctm_dequeue.c +++ b/usr.sbin/ctm/ctm_dequeue/ctm_dequeue.c @@ -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 :-( */