From: Matthew Newton Date: Tue, 24 Jul 2018 16:02:26 +0000 (+0100) Subject: actually unlock files, rather that just locking them again :( X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2e71c96dfcd48b7e863589b47447996b35083fa2;p=thirdparty%2Ffreeradius-server.git actually unlock files, rather that just locking them again :( --- diff --git a/src/lib/util/misc.c b/src/lib/util/misc.c index 99e9887f73d..7a7d82003ac 100644 --- a/src/lib/util/misc.c +++ b/src/lib/util/misc.c @@ -189,10 +189,10 @@ int rad_unlockfd(int fd, int lock_len) fl.l_start = 0; fl.l_len = lock_len; fl.l_pid = getpid(); - fl.l_type = F_WRLCK; + fl.l_type = F_UNLCK; fl.l_whence = SEEK_CUR; - return fcntl(fd, F_UNLCK, (void *)&fl); + return fcntl(fd, F_SETLK, (void *)&fl); #else #error "missing definition for F_WRLCK, all file locks will fail"