Project

General

Profile

Actions

Bug #16159

closed

Global: global_init_prefork() can't catch ftruncate error of pidfh

Added by xie xingguo almost 8 years ago. Updated almost 8 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
-
Target version:
-
% Done:

0%

Source:
Community (dev)
Tags:
Backport:
jewel
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

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);

```

Actions #1

Updated by xie xingguo almost 8 years ago

  • Status changed from New to Fix Under Review
Actions #2

Updated by Kefu Chai almost 8 years ago

  • Assignee set to xie xingguo
  • Source changed from other to Community (dev)
  • Backport set to jewel
Actions #3

Updated by xie xingguo almost 8 years ago

  • Status changed from Fix Under Review to Resolved
Actions

Also available in: Atom PDF