Actions
Bug #16159
closedGlobal: global_init_prefork() can't catch ftruncate error of pidfh
% Done:
0%
Source:
Community (dev)
Tags:
Backport:
jewel
Regression:
No
Severity:
3 - minor
Reviewed:
Description
```
if (::ftruncate(pf_fd, 0) < 0) {
int err = errno;
derr << func << ": failed to ftruncate the pid file '"
<< pf_path << "': " << cpp_strerror(err) << dendl;
return err;
}
```
See above, we shall negative the error returning, as we usually do, otherwise global callers such as global_init_prefork() won't catch postive error codes:
```
if (pidfile_write(conf) < 0)
exit(1);
```
Updated by xie xingguo almost 8 years ago
- Status changed from New to Fix Under Review
Master PR:
https://github.com/ceph/ceph/pull/9378
Updated by Kefu Chai almost 8 years ago
- Assignee set to xie xingguo
- Source changed from other to Community (dev)
- Backport set to jewel
Updated by xie xingguo almost 8 years ago
- Status changed from Fix Under Review to Resolved
Actions