struct xseg_request_copy *xcopy = (struct xseg_request_copy *) xseg_get_data(store->xseg, req);
struct stat st;
int n, src, dst;
+ char buf[XSEG_MAX_TARGETLEN+1];
char *target = xseg_get_target(store->xseg, req);
dst = dir_open(store, io, target, req->targetlen, 1);
return;
}
- src = openat(store->dirfd, xcopy->target, O_RDWR);
+ strncpy(buf, xcopy->target, xcopy->targetlen);
+ buf[xcopy->targetlen] = 0;
+ src = openat(store->dirfd, buf, O_RDWR);
if (src < 0) {
if (errno == ENOENT){
- src = openat(store->dirfd, xcopy->target,
+ src = openat(store->dirfd, buf,
O_RDWR | O_CREAT, 0600);
if (src < 0 ) {
fprintf(stderr, "fail in src\n");
for (;;) {
accepted = NULL;
- accepted = xseg_accept(xseg, portno);
+ accepted = xseg_accept(xseg, portno, 0);
if (accepted) {
io->req = accepted;
wake_up_next_iothread(store);
if (!store->xseg)
return -1;
- store->xport = xseg_bind_port(store->xseg, portno);
+ store->xport = xseg_bind_port(store->xseg, portno, NULL);
if (!store->xport) {
printf("cannot bind to port %ld\n", portno);
return -1;