]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
src/global/pidfile.cc: Assign elements in structures individually 10516/head
authorWillem Jan Withagen <wjw@digiware.nl>
Sun, 31 Jul 2016 21:08:16 +0000 (23:08 +0200)
committerWillem Jan Withagen <wjw@digiware.nl>
Sun, 31 Jul 2016 21:08:16 +0000 (23:08 +0200)
 - 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 <wjw@digiware.nl>
src/global/pidfile.cc

index 23cca35bf96474c9c2a36527b7009210c689b84a..2f70cd02e110232e13a194c30aeea279081821dd 100644 (file)
@@ -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 "