]> git.pld-linux.org Git - packages/extundelete.git/blame - extundelete-dirs.patch
- fix building with recent e2fsprogs
[packages/extundelete.git] / extundelete-dirs.patch
CommitLineData
4ca937f5
MB
1--- extundelete-0.2.4/src/extundelete.cc.orig 2014-12-24 14:00:40.401233636 +0100
2+++ extundelete-0.2.4/src/extundelete.cc 2014-12-25 01:29:09.076514586 +0100
3@@ -1777,6 +1777,23 @@ errcode_t restore_inode(ext2_filsys fs,
f50bab4c
TP
4 retval = EU_RESTORE_FAIL;
5 }
6 }
7+ else if (LINUX_S_ISDIR(inode->i_mode)) {
4ca937f5
MB
8+ if(mkdir((outputdir2 + fname2).c_str(), 0700)) {
9+ struct timeval times[2];
10+ chmod((outputdir + fname2).c_str(),inode->i_mode);
11+ lchown((outputdir + fname2).c_str(),inode->i_uid,inode->i_gid);
12+ times[0].tv_sec=inode->i_atime; times[0].tv_usec=0;
13+ times[1].tv_sec=inode->i_mtime; times[1].tv_usec=0;
14+ utimes((outputdir + fname2).c_str(),times);
15+ std::cout << "Restored inode " << ino << " as directory ";
16+ std::cout << (outputdir + fname2) << " deleted " << asctime(localtime((time_t*)&inode->i_dtime));
17+ retval = 0;
18+ } else {
19+ std::cout << "Failed to restore inode " << ino << " as directory ";
20+ std::cout << (outputdir + fname2) << " deleted " << asctime(localtime((time_t*)&inode->i_dtime));
21+ retval = EU_RESTORE_FAIL;
22+ }
f50bab4c
TP
23+ }
24 else {
4ca937f5
MB
25 Log::info << "extundelete identified inode " << ino << " as "
26 << (outputdir + fname2) << ":"
This page took 0.076313 seconds and 4 git commands to generate.