예제 #1
0
파일: http.c 프로젝트: Abioy/sheepdog
static int generate_url(const char *buff, int size, char *url, int url_len)
{
	char address[PATH_MAX], *ch;
	int len, ret = 0;

	len = shadow_file_read(PATH_HTTP_ADDRESS, address, sizeof(address), 0);
	if (len <= 0) {
		sheepfs_pr("Can't get address of http");
		ret = -EINVAL;
		goto out;
	}

	/* remove last '\n' of address */
	ch = strchr(address, '\n');
	if (ch != NULL)
		*ch = '\0';

	snprintf(url, url_len, "http://%s/v1%.*s", address, size, buff);
out:
	return ret;
}
예제 #2
0
파일: vdi.c 프로젝트: Vinchal/sheepdog
int vdi_list_read(const char *path, char *buf, size_t size, off_t ignore)
{
	return shadow_file_read(path, buf, size, 0);
}
예제 #3
0
파일: http.c 프로젝트: Abioy/sheepdog
int http_address_read(const char *path, char *buf, size_t size, off_t ignore,
		      struct fuse_file_info *fi)
{
	return shadow_file_read(path, buf, size, 0);
}
예제 #4
0
파일: node.c 프로젝트: ChrisChung/sheepdog
int node_info_read(const char *path, char *buf, size_t size, off_t ignore)
{
	return shadow_file_read(path, buf, size, 0);
}