if (parentdir != (ino_t)-1)
if (parentdir != (ino_t)-1) {
linkup(orphan, parentdir)	ino_t orphan;	ino_t parentdir;{	register struct dinode *dp;	int lostdir;	ino_t oldlfdir;	struct inodesc idesc;	char tempname[BUFSIZ];	memset(&idesc, 0, sizeof(struct inodesc));	dp = ginode(orphan);	lostdir = (dp->di_mode & IFMT) == IFDIR;	pwarn("UNREF %s ", lostdir ? "DIR" : "FILE");	pinode(orphan);	if (preen && dp->di_size == 0)		return (0);	if (preen)		printf(" (RECONNECTED)\n");	else		if (reply("RECONNECT") == 0)			return (0);	if (lfdir == 0) {		dp = ginode(ROOTINO);		idesc.id_name = lfname;		idesc.id_type = DATA;		idesc.id_func = findino;		idesc.id_number = ROOTINO;		if ((ckinode(dp, &idesc) & FOUND) != 0) {			lfdir = idesc.id_parent;		} else {			pwarn("NO lost+found DIRECTORY");			if (preen || reply("CREATE")) {				lfdir = allocdir(ROOTINO, (ino_t)0, lfmode);				if (lfdir != 0) {					if (makeentry(ROOTINO, lfdir, lfname) != 0) {						if (preen)							printf(" (CREATED)\n");					} else {						freedir(lfdir, ROOTINO);						lfdir = 0;						if (preen)							printf("\n");					}				}			}		}		if (lfdir == 0) {			pfatal("SORRY. CANNOT CREATE lost+found DIRECTORY");			printf("\n\n");			return (0);		}	}	dp = ginode(lfdir);	if ((dp->di_mode & IFMT) != IFDIR) {		pfatal("lost+found IS NOT A DIRECTORY");		if (reply("REALLOCATE") == 0)			return (0);		oldlfdir = lfdir;		if ((lfdir = allocdir(ROOTINO, (ino_t)0, lfmode)) == 0) {			pfatal("SORRY. CANNOT CREATE lost+found DIRECTORY\n\n");			return (0);		}		if ((changeino(ROOTINO, lfname, lfdir) & ALTERED) == 0) {			pfatal("SORRY. CANNOT CREATE lost+found DIRECTORY\n\n");			return (0);		}		inodirty();		idesc.id_type = ADDR;		idesc.id_func = pass4check;		idesc.id_number = oldlfdir;		adjust(&idesc, lncntp[oldlfdir] + 1);		lncntp[oldlfdir] = 0;		dp = ginode(lfdir);	}	if (statemap[lfdir] != DFOUND) {		pfatal("SORRY. NO lost+found DIRECTORY\n\n");		return (0);	}	(void)lftempname(tempname, orphan);	if (makeentry(lfdir, orphan, tempname) == 0) {		pfatal("SORRY. NO SPACE IN lost+found DIRECTORY");		printf("\n\n");		return (0);	}	lncntp[orphan]--;	if (lostdir) {		if ((changeino(orphan, "..", lfdir) & ALTERED) == 0 &&		    parentdir != (ino_t)-1)			(void)makeentry(orphan, lfdir, "..");		dp = ginode(lfdir);		dp->di_nlink++;		inodirty();		lncntp[lfdir]++;		pwarn("DIR I=%u CONNECTED. ", orphan);		if (parentdir != (ino_t)-1)			printf("PARENT WAS I=%u\n", parentdir);		if (preen == 0)			printf("\n");	}	return (1);}