if (cp = getgroupname(stb.st_gid, target, o))
if ((cp = getgroupname(stb.st_gid, target, o)))
static void recvdir(opts, mode, owner, group)	opt_t opts;	int mode;	char *owner, *group;{	static char lowner[100], lgroup[100];	register char *cp;	struct stat stb;	int s;	s = lstat(target, &stb);	if (s == 0) {		/*		 * If target is not a directory, remove it		 */		if (!S_ISDIR(stb.st_mode)) {			if (IS_ON(opts, DO_VERIFY))				message(MT_NOTICE, "%s: need to remove",					target);			else {				if (unlink(target) < 0) {					error("%s: remove failed: %s",					      target, SYSERR);					return;				}			}			s = -1;			errno = ENOENT;		} else {			if (!IS_ON(opts, DO_NOCHKMODE) &&			    (stb.st_mode & 07777) != mode) {				if (IS_ON(opts, DO_VERIFY))					message(MT_NOTICE, 						"%s: need to chmod to %o",						target, mode);				else {					if (chmod(target, mode) != 0)						message(MT_NOTICE,					  "%s: chmod from %o to %o failed: %s",							target, 							stb.st_mode & 07777, 							mode,							SYSERR);					else						message(MT_NOTICE,						"%s: chmod from %o to %o",							target, 							stb.st_mode & 07777, 							mode);				}			}			/*			 * Check ownership and set if necessary			 */			lowner[0] = CNULL;			lgroup[0] = CNULL;			if (!IS_ON(opts, DO_NOCHKOWNER) && owner) {				int o;				o = (owner[0] == ':') ? opts & DO_NUMCHKOWNER :					opts;				if (cp = getusername(stb.st_uid, target, o))					if (strcmp(owner, cp))						(void) strcpy(lowner, cp);			}			if (!IS_ON(opts, DO_NOCHKGROUP) && group) {				int o;				o = (group[0] == ':') ? opts & DO_NUMCHKGROUP :					opts;				if (cp = getgroupname(stb.st_gid, target, o))					if (strcmp(group, cp))						(void) strcpy(lgroup, cp);			}			/*			 * Need to set owner and/or group			 */#define PRN(n) ((n[0] == ':') ? n+1 : n)			if (lowner[0] != CNULL || lgroup[0] != CNULL) {				if (lowner[0] == CNULL && 				    (cp = getusername(stb.st_uid, 						      target, opts)))					(void) strcpy(lowner, cp);				if (lgroup[0] == CNULL && 				    (cp = getgroupname(stb.st_gid, 						       target, opts)))					(void) strcpy(lgroup, cp);				if (IS_ON(opts, DO_VERIFY))					message(MT_NOTICE,				"%s: need to chown from %s.%s to %s.%s",						target, 						PRN(lowner), PRN(lgroup),						PRN(owner), PRN(group));				else {					if (fchog(-1, target, owner, 						  group, -1) == 0)						message(MT_NOTICE,					       "%s: chown from %s.%s to %s.%s",							target,							PRN(lowner), 							PRN(lgroup),							PRN(owner), 							PRN(group));				}			}#undef PRN			ack();			return;		}	}	if (IS_ON(opts, DO_VERIFY)) {		ack();		return;	}	/*	 * Create the directory	 */	if (s < 0) {		if (errno == ENOENT) {			if (mkdir(target, mode) == 0 ||			    chkparent(target, opts) == 0 && 			    mkdir(target, mode) == 0) {				message(MT_NOTICE, "%s: mkdir", target);				(void) fchog(-1, target, owner, group, mode);				ack();			} else {				error("%s: mkdir failed: %s", target, SYSERR);				ptarget = sptarget[--catname];				*ptarget = CNULL;			}			return;		}	}	error("%s: lstat failed: %s", target, SYSERR);	ptarget = sptarget[--catname];	*ptarget = CNULL;}