int (*makelink)(const tchar *oldpath, const tchar *newpath))
{
if ((*makelink)(oldpath, newpath)) {
- if (errno == EEXIST) {
- if (unlink(newpath))
- return WIMLIB_ERR_LINK;
- if ((*makelink)(oldpath, newpath))
- return WIMLIB_ERR_LINK;
- return 0;
- }
- return WIMLIB_ERR_LINK;
+ if (errno != EEXIST)
+ return WIMLIB_ERR_LINK;
+ if (unlink(newpath))
+ return WIMLIB_ERR_LINK;
+ if ((*makelink)(oldpath, newpath))
+ return WIMLIB_ERR_LINK;
}
return 0;
}
if (raw_fd < 0)
return WIMLIB_ERR_OPEN;
filedes_init(&fd, raw_fd);
- ret = extract_wim_resource_to_fd(lte, &fd, wim_resource_size(lte));
+ ret = extract_full_stream_to_fd(lte, &fd);
if (filedes_close(&fd) && !ret)
ret = WIMLIB_ERR_WRITE;
return ret;