From b2c30136dce9d9cb14afc1431f83b8e4bf75ee0a Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Mon, 31 Aug 2009 18:26:16 +0200 Subject: maint: chown, chgrp, chmod, chcon: remove unnecessary initialization * src/chown-core.c: Include "ignore-value.h". (change_file_owner): Don't set "ent" only to ignore it. * src/chcon.c (process_file): Likewise. * src/chmod.c: Include "ignore-value.h". (process_file): Don't set "ent" only to ignore it. After diagnosing root-dev/ino failure, return false immediately: Now that we don't set "ent" we must be sure not to use it uninitialized, and there's no point in issuing --verbose-related output in this case. --- src/chmod.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/chmod.c') diff --git a/src/chmod.c b/src/chmod.c index 0e39c8b01..aeefcc65a 100644 --- a/src/chmod.c +++ b/src/chmod.c @@ -25,6 +25,7 @@ #include "dev-ino.h" #include "error.h" #include "filemode.h" +#include "ignore-value.h" #include "modechange.h" #include "quote.h" #include "quotearg.h" @@ -238,8 +239,8 @@ process_file (FTS *fts, FTSENT *ent) /* Tell fts not to traverse into this hierarchy. */ fts_set (fts, ent, FTS_SKIP); /* Ensure that we do not process "/" on the second visit. */ - ent = fts_read (fts); - ok = false; + ignore_ptr (fts_read (fts)); + return false; } if (ok) -- cgit v1.2.3-54-g00ecf