From: Willem Jan Withagen Date: Sun, 31 Jul 2016 21:08:16 +0000 (+0200) Subject: src/global/pidfile.cc: Assign elements in structures individually X-Git-Tag: ses5-milestone5~87^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=4c9a23173978c845fa4c8b0b0f82a7c0951966c3;p=ceph.git src/global/pidfile.cc: Assign elements in structures individually - Assigning structure is better per element. The order of elements is not always the same in very OS. So "hardcoding" can/will assign to the wrong elements Signed-off-by: Willem Jan Withagen --- diff --git a/src/global/pidfile.cc b/src/global/pidfile.cc index 23cca35bf964..2f70cd02e110 100644 --- a/src/global/pidfile.cc +++ b/src/global/pidfile.cc @@ -162,7 +162,12 @@ int pidfh::open(const md_config_t *conf) pf_dev = st.st_dev; pf_ino = st.st_ino; - struct flock l = { F_WRLCK, SEEK_SET, 0, 0, 0 }; + struct flock l = { + .l_type = F_WRLCK, + .l_whence = SEEK_SET, + .l_start = 0, + .l_len = 0 + }; int r = ::fcntl(pf_fd, F_SETLK, &l); if (r < 0) { derr << __func__ << ": failed to lock pidfile "