diff options
author | Mrunal Patel <mrunalp@gmail.com> | 2016-05-12 13:19:22 -0700 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2016-05-19 00:49:50 +0000 |
commit | 649a4efbb8439302f15be35563fe19ef2fc248b8 (patch) | |
tree | 0d8e6a4c012da9d7b37c5ab8484514449240589c | |
parent | d69ab9202be611f853a8ff81b5c785996e4dc6a9 (diff) | |
download | bubblewrap-649a4efbb8439302f15be35563fe19ef2fc248b8.tar.gz |
Use struct initializer
Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
Closes: #68
Approved by: cgwalters
-rw-r--r-- | bubblewrap.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/bubblewrap.c b/bubblewrap.c index 1f9331a..50c7278 100644 --- a/bubblewrap.c +++ b/bubblewrap.c @@ -310,15 +310,15 @@ do_init (int event_fd, pid_t initial_pid) for (lock = lock_files; lock != NULL; lock = lock->next) { int fd = open (lock->path, O_RDONLY | O_CLOEXEC); - struct flock l = {0}; - if (fd == -1) die_with_error ("Unable to open lock file %s", lock->path); - l.l_type = F_RDLCK; - l.l_whence = SEEK_SET; - l.l_start = 0; - l.l_len = 0; + struct flock l = { + .l_type = F_RDLCK, + .l_whence = SEEK_SET, + .l_start = 0, + .l_len = 0 + }; if (fcntl (fd, F_SETLK, &l) < 0) die_with_error ("Unable to lock file %s", lock->path); |