コード例 #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);
}