mirror of
https://github.com/s3fs-fuse/s3fs-fuse.git
synced 2024-09-28 17:29:02 +00:00
Chaged codes about iterator
This commit is contained in:
parent
84fb3d83d8
commit
0ecf4aa6b4
14
src/s3fs.cpp
14
src/s3fs.cpp
@ -3119,24 +3119,26 @@ static int s3fs_removexattr(const char* path, const char* name)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// get xattrs
|
// get xattrs
|
||||||
if(meta.end() == meta.find("x-amz-meta-xattr")){
|
headers_t::iterator hiter = meta.find("x-amz-meta-xattr");
|
||||||
|
if(meta.end() == hiter){
|
||||||
// object does not have xattrs
|
// object does not have xattrs
|
||||||
return -ENOATTR;
|
return -ENOATTR;
|
||||||
}
|
}
|
||||||
string strxattrs = meta["x-amz-meta-xattr"];
|
string strxattrs = hiter->second;
|
||||||
|
|
||||||
parse_xattrs(strxattrs, xattrs);
|
parse_xattrs(strxattrs, xattrs);
|
||||||
|
|
||||||
// check name xattrs
|
// check name xattrs
|
||||||
string strname = name;
|
string strname = name;
|
||||||
if(xattrs.end() == xattrs.find(strname)){
|
xattrs_t::iterator xiter = xattrs.find(strname);
|
||||||
|
if(xattrs.end() == xiter){
|
||||||
free_xattrs(xattrs);
|
free_xattrs(xattrs);
|
||||||
return -ENOATTR;
|
return -ENOATTR;
|
||||||
}
|
}
|
||||||
|
|
||||||
// make new header_t after deleting name xattr
|
// make new header_t after deleting name xattr
|
||||||
if(xattrs[strname]){
|
if(xiter->second){
|
||||||
delete xattrs[strname];
|
delete xiter->second;
|
||||||
}
|
}
|
||||||
xattrs.erase(strname);
|
xattrs.erase(strname);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user