lfd = sdb_open(path, O_RDONLY);
if(lfd < 0) {
- fprintf(stderr,"cannot open '%s': %s\n", path, strerror(errno));
+ fprintf(stderr,"cannot open '%s': errno:%d\n", path, errno);
return -1;
}
if(ret < 0) {
if(errno == EINTR)
continue;
- fprintf(stderr,"cannot read '%s': %s\n", path, strerror(errno));
+ fprintf(stderr,"cannot read '%s': errno:%d\n", path, errno);
break;
}
len = readlink(path, sbuf->data, SYNC_DATA_MAX-1);
if(len < 0) {
- fprintf(stderr, "error reading link '%s': %s\n", path, strerror(errno));
+ fprintf(stderr, "error reading link '%s': errno:%d\n", path, errno);
return -1;
}
sbuf->data[len] = '\0';
// this requires that we read the entire file into memory.
lfd = sdb_open(lpath, O_RDONLY);
if(lfd < 0) {
- fprintf(stderr,"cannot open '%s': %s\n", lpath, strerror(errno));
+ fprintf(stderr,"cannot open '%s': errno:%d\n", lpath, errno);
return -1;
}
mkdirs((char *)lpath);
lfd = sdb_creat(lpath, 0644);
if(lfd < 0) {
- fprintf(stderr,"cannot create '%s': %s\n", lpath, strerror(errno));
+ fprintf(stderr,"cannot create '%s': errno:%d\n", lpath, errno);
return -1;
}
goto handle_data;
}
if(writex(lfd, buffer, len)) {
- fprintf(stderr,"cannot write '%s': %s\n", rpath, strerror(errno));
+ fprintf(stderr,"cannot write '%s': errno:%d\n", rpath, errno);
sdb_close(lfd);
return -1;
}
d = opendir(lpath);
if(d == 0) {
- fprintf(stderr,"cannot open '%s': %s\n", lpath, strerror(errno));
+ fprintf(stderr,"cannot open '%s': errno:%d\n", lpath, errno);
return -1;
}
} else {
ci = mkcopyinfo(lpath, rpath, name, 0);
if(lstat(ci->src, &st)) {
- fprintf(stderr,"cannot stat '%s': %s\n", ci->src, strerror(errno));
+ fprintf(stderr,"cannot stat '%s': errno:%d\n", ci->src, errno);
closedir(d);
return -1;
}
if(!S_ISREG(st.st_mode) && !S_ISLNK(st.st_mode)) {
- fprintf(stderr, "skipping special file '%s'\n", ci->src);
+ fprintf(stderr, "skipping special file\n");
free(ci);
} else {
ci->time = st.st_mtime;
}
if(stat(lpath, &st)) {
- fprintf(stderr,"cannot stat '%s': %s\n", lpath, strerror(errno));
+ fprintf(stderr,"cannot stat '%s': errno:%d\n", lpath, errno);
sync_quit(fd);
return 1;
}
return 1;
}
if(mode == 0) {
- fprintf(stderr,"remote object '%s' does not exist\n", rpath);
+ fprintf(stderr,"'%s': No such file or directory\n", rpath);
+ sync_quit(fd);
return 1;
}
return 0;
}
} else {
- fprintf(stderr,"remote object '%s' not a file or directory\n", rpath);
+ fprintf(stderr,"'%s': No such file or directory\n", rpath);
return 1;
}
}