Exemple #1
0
// Return 1 if the backup is now finalising.
int check_for_rubble(struct async *as,
	struct sdirs *sdirs, const char *incexc,
	int *resume, struct conf **cconfs)
{
	struct asfd *asfd=as->asfd;

	switch(is_lnk(sdirs->finishing))
	{
		case 1:
			if(recover_finishing(as, sdirs, cconfs))
				return -1;
			return 1;
		case 0:
			log_and_send(asfd,
				"Finishing directory is not a symlink.\n");
			return -1;
	}

	switch(is_lnk(sdirs->working))
	{
		case 1:
			return recover_working(as,
				sdirs, incexc, resume, cconfs);
		case 0:
			log_and_send(asfd,
				"Working directory is not a symlink.\n");
			return -1;
	}

	switch(is_lnk(sdirs->currenttmp))
	{
		case 1:
			return recover_currenttmp(sdirs);
		case 0:
			log_and_send(asfd,
				"Currenttmp directory is not a symlink.\n");
			return -1;
	}

	return 0;
}
Exemple #2
0
// Return 1 if the backup is now finalising.
int check_for_rubble(struct async *as,
	struct sdirs *sdirs, const char *incexc,
	int *resume, struct conf **cconfs)
{
	struct stat statp;
	struct asfd *asfd=as->asfd;

	if(!lstat(sdirs->finishing, &statp))
	{
		if(S_ISLNK(statp.st_mode))
		{
			if(recover_finishing(as, sdirs, cconfs))
				return -1;
			return 1;
		}
		log_and_send(asfd, "Finishing directory is not a symlink.\n");
		return -1;
	}

	if(!lstat(sdirs->working, &statp))
	{
		if(S_ISLNK(statp.st_mode))
			return recover_working(as,
				sdirs, incexc, resume, cconfs);
		log_and_send(asfd, "Working directory is not a symlink.\n");
		return -1;
	}

	if(!lstat(sdirs->currenttmp, &statp))
	{
		if(S_ISLNK(statp.st_mode))
			return recover_currenttmp(sdirs);
		log_and_send(asfd, "Currenttmp directory is not a symlink.\n");
		return -1;
	}

	return 0;
}