diff options
author | Guilhem Moulin <guilhem@fripost.org> | 2016-03-13 16:23:26 +0100 |
---|---|---|
committer | Guilhem Moulin <guilhem@fripost.org> | 2016-03-13 16:23:26 +0100 |
commit | 11c1344bdadb5a5aca061e1a5483c05c3b2c746e (patch) | |
tree | 49e3d39080b2cb07ba5449859273d0e73b3d35f2 /pullimap | |
parent | 3bc3cc8ed99ab1b23fb20f94ba610c24d404455c (diff) |
pullimap: fix struct flock packing
Diffstat (limited to 'pullimap')
-rwxr-xr-x | pullimap | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -83,7 +83,9 @@ do { } sysopen($STATE, $statefile, O_CREAT|O_RDWR|O_DSYNC, 0600) or die "Can't open $statefile: $!"; - fcntl($STATE, F_SETLK, pack('sslll', F_WRLCK, SEEK_SET, 0, 0, $$)) or die "Can't lock $statefile: $!"; + # XXX we need to pack the struct flock manually: not portable! + my $struct_flock = pack('s!s!l!l!i!', F_WRLCK, SEEK_SET, 0, 0, 0); + fcntl($STATE, F_SETLK, $struct_flock) or die "Can't lock $statefile: $!"; my $flags = fcntl($STATE, F_GETFD, 0) or die "fcntl F_GETFD: $!"; fcntl($STATE, F_SETFD, $flags | FD_CLOEXEC) or die "fcntl F_SETFD: $!"; }; |