mirror of
https://github.com/GothenburgBitFactory/taskshell.git
synced 2025-06-26 10:54:29 +02:00
FS: Eliminated compiler warnings
This commit is contained in:
parent
8c7c882b90
commit
55548c9f3d
1 changed files with 6 additions and 2 deletions
|
@ -434,7 +434,9 @@ bool File::lock ()
|
|||
if (_fh && _h != -1)
|
||||
{
|
||||
// l_type l_whence l_start l_len l_pid
|
||||
struct flock fl = {F_WRLCK, SEEK_SET, 0, 0, 0 };
|
||||
struct flock fl {};
|
||||
fl.l_type = F_WRLCK;
|
||||
fl.l_whence = SEEK_SET;
|
||||
fl.l_pid = getpid ();
|
||||
if (fcntl (_h, F_SETLKW, &fl) == 0)
|
||||
_locked = true;
|
||||
|
@ -449,7 +451,9 @@ void File::unlock ()
|
|||
if (_locked)
|
||||
{
|
||||
// l_type l_whence l_start l_len l_pid
|
||||
struct flock fl = {F_UNLCK, SEEK_SET, 0, 0, 0 };
|
||||
struct flock fl {};
|
||||
fl.l_type = F_UNLCK;
|
||||
fl.l_whence = SEEK_SET;
|
||||
fl.l_pid = getpid ();
|
||||
|
||||
fcntl (_h, F_SETLK, &fl);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue