"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/libdar/filesystem_hard_link_write.cpp" between
dar-2.6.1.tar.gz and dar-2.6.2.tar.gz

About: DAR (Disk ARchive) is a shell command that makes backup of a directory tree and files.

filesystem_hard_link_write.cpp  (dar-2.6.1):filesystem_hard_link_write.cpp  (dar-2.6.2)
skipping to change at line 258 skipping to change at line 258
const cat_blockdev *ref_blo = dynamic_cast<const cat_blockdev *>(ref); const cat_blockdev *ref_blo = dynamic_cast<const cat_blockdev *>(ref);
const cat_chardev *ref_cha = dynamic_cast<const cat_chardev *>(ref); const cat_chardev *ref_cha = dynamic_cast<const cat_chardev *>(ref);
const cat_tube *ref_tub = dynamic_cast<const cat_tube *>(ref); const cat_tube *ref_tub = dynamic_cast<const cat_tube *>(ref);
const cat_prise *ref_pri = dynamic_cast<const cat_prise *>(ref); const cat_prise *ref_pri = dynamic_cast<const cat_prise *>(ref);
const cat_mirage *ref_mir = dynamic_cast <const cat_mirage *>(ref); const cat_mirage *ref_mir = dynamic_cast <const cat_mirage *>(ref);
const cat_inode *ref_ino = dynamic_cast <const cat_inode *>(ref); const cat_inode *ref_ino = dynamic_cast <const cat_inode *>(ref);
if(ref_ino == nullptr && ref_mir == nullptr) if(ref_ino == nullptr && ref_mir == nullptr)
throw SRC_BUG; // neither an cat_inode nor a hard link throw SRC_BUG; // neither an cat_inode nor a hard link
const string display = (ou + ref->get_name()).display(); const string display = (ou.append(ref->get_name())).display();
const char *name = display.c_str(); const char *name = display.c_str();
S_I ret = -1; // will carry the system call returned value used to create the requested file S_I ret = -1; // will carry the system call returned value used to create the requested file
do do
{ {
try try
{ {
if(ref_mir != nullptr) // we potentially have to make a hard link if(ref_mir != nullptr) // we potentially have to make a hard link
{ {
skipping to change at line 430 skipping to change at line 430
if(ret >= 0) if(ret >= 0)
{ {
S_I sd = ret; S_I sd = ret;
struct sockaddr_un addr; struct sockaddr_un addr;
addr.sun_family = AF_UNIX; addr.sun_family = AF_UNIX;
try try
{ {
strncpy(addr.sun_path, name, UNIX_PATH_MAX - 1); strncpy(addr.sun_path, name, UNIX_PATH_MAX - 1);
addr.sun_path[UNIX_PATH_MAX - 1] = '\0'; addr.sun_path[UNIX_PATH_MAX - 1] = '\0';
if(strlen(addr.sun_path) < strlen(name))
get_ui().pause(tools_printf(gettext("error restor
ing Unix socket %s, path too long to be stored properly, socket will be created
as %s instead, do you confirm?"), name, addr.sun_path));
if(::bind(sd, (struct sockaddr *)&addr, sizeof(addr)) < 0) if(::bind(sd, (struct sockaddr *)&addr, sizeof(addr)) < 0)
throw Erange("filesystem_hard_link_write::make_fi le (socket bind)", string(gettext("Error creating Unix socket file: ")) + name + " : " + tools_strerror_r(errno)); throw Erange("filesystem_hard_link_write::make_fi le (socket bind)", string(gettext("Error creating Unix socket file: ")) + name + " : " + tools_strerror_r(errno));
} }
catch(...) catch(...)
{ {
shutdown(sd, 2); shutdown(sd, 2);
close(sd); close(sd);
throw; throw;
} }
shutdown(sd, 2); shutdown(sd, 2);
 End of changes. 2 change blocks. 
1 lines changed or deleted 5 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)