if ((params->add_image_flags & WIMLIB_ADD_IMAGE_FLAG_RPFIX) &&
dest[0] == '/')
{
- dest = fixup_symlink(dest,
- params->capture_root_ino,
- params->capture_root_dev);
+ dest = capture_fixup_absolute_symlink(dest,
+ params->capture_root_ino,
+ params->capture_root_dev);
if (!dest) {
WARNING("Ignoring out of tree absolute symlink "
"\"%s\" -> \"%s\"\n"
inode->i_nlink = 1;
inode->i_next_stream_id = 1;
inode->i_not_rpfixed = 1;
+ INIT_LIST_HEAD(&inode->i_list);
#ifdef WITH_FUSE
if (pthread_mutex_init(&inode->i_mutex, NULL) != 0) {
ERROR_WITH_ERRNO("Error initializing mutex");
wimlib_assert(inode->i_num_opened_fds == 0);
FREE(inode->i_fds);
pthread_mutex_destroy(&inode->i_mutex);
- if (inode->i_hlist.pprev)
- hlist_del(&inode->i_hlist);
#endif
+ /* HACK: This may instead delete the inode from i_list, but the
+ * hlist_del() behaves the same as list_del(). */
+ hlist_del(&inode->i_hlist);
FREE(inode->i_extracted_file);
FREE(inode);
}
return WIMLIB_ERR_INVALID_DENTRY;
}
/* Free the unneeded `struct wim_inode'. */
- dentry->d_inode->i_hlist.next = NULL;
- dentry->d_inode->i_hlist.pprev = NULL;
free_inode(dentry->d_inode);
dentry->d_inode = ref_inode;
ref_inode->i_nlink++;
INIT_LIST_HEAD(inode_list);
for (u64 i = 0; i < table->capacity; i++) {
hlist_for_each_entry_safe(inode, cur, tmp, &table->array[i], i_hlist) {
+ INIT_LIST_HEAD(&inode->i_list);
ret = fix_nominal_inode(inode, inode_list, ino_changes_needed);
if (ret)
return ret;
{
struct stat stbuf;
if (stat(path, &stbuf)) {
- WARNING_WITH_ERRNO("Failed to stat \"%s\"", path);
+ if (errno != ENOENT)
+ WARNING_WITH_ERRNO("Failed to stat \"%s\"", path);
/* Treat as a link pointing outside the capture root (it
* most likely is). */
return WIMLIB_ERR_STAT;
/* Fix up absolute symbolic link targets--- mostly shared between UNIX and
* Windows */
tchar *
-fixup_symlink(tchar *dest, u64 capture_root_ino, u64 capture_root_dev)
+capture_fixup_absolute_symlink(tchar *dest,
+ u64 capture_root_ino, u64 capture_root_dev)
{
tchar *p = dest;
struct wim_lookup_table *lookup_table);
#endif
extern tchar *
-fixup_symlink(tchar *dest, u64 capture_root_ino, u64 capture_root_dev);
+capture_fixup_absolute_symlink(tchar *dest,
+ u64 capture_root_ino, u64 capture_root_dev);
/* resource.c */
hFile = win32_open_existing_file(path, FILE_READ_ATTRIBUTES);
if (hFile == INVALID_HANDLE_VALUE) {
err = GetLastError();
- WARNING("Failed to open \"%ls\" to get file and volume IDs",
- path);
- win32_error(err);
+ if (err != ERROR_FILE_NOT_FOUND) {
+ WARNING("Failed to open \"%ls\" to get file "
+ "and volume IDs", path);
+ win32_error(err);
+ }
return WIMLIB_ERR_OPEN;
}
stripped_chars = ret;
target[target_nchars] = L'\0';
orig_target = target;
- target = fixup_symlink(target + stripped_chars,
- capture_root_ino, capture_root_dev);
+ target = capture_fixup_absolute_symlink(target + stripped_chars,
+ capture_root_ino, capture_root_dev);
if (!target)
return RP_EXCLUDED;
target_nchars = wcslen(target);