X-Git-Url: https://wimlib.net/git/?a=blobdiff_plain;f=src%2Funix_apply.c;h=0a2a04f46f3b94e20136e5ad3a4729b7992d908a;hb=7a66a5903a8c2227b9341a6486e4c2ea989fb5bd;hp=3940d33a07cbf85d1ea209e2472ca8033610e99a;hpb=e3689bfa91c108ea0f5c86160bd594f98cd541a6;p=wimlib diff --git a/src/unix_apply.c b/src/unix_apply.c index 3940d33a..0a2a04f4 100644 --- a/src/unix_apply.c +++ b/src/unix_apply.c @@ -85,14 +85,12 @@ unix_makelink(const tchar *oldpath, const tchar *newpath, 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; } @@ -124,7 +122,7 @@ unix_extract_unnamed_stream(file_spec_t file, 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;