From: Alan T. DeKok Date: Tue, 25 Jul 2017 14:25:42 +0000 (-0400) Subject: remove unused exfile_unlock() X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0e5707fffb7ceccb8b2e4ef2d266c88d83e16bba;p=thirdparty%2Ffreeradius-server.git remove unused exfile_unlock() --- diff --git a/src/include/exfile.h b/src/include/exfile.h index a3bfbcc9900..037e374c62a 100644 --- a/src/include/exfile.h +++ b/src/include/exfile.h @@ -45,8 +45,6 @@ int exfile_open(exfile_t *lf, REQUEST *request, char const *filename, int exfile_close(exfile_t *lf, REQUEST *request, int fd); -int exfile_unlock(exfile_t *lf, REQUEST *request, int fd); - #ifdef __cplusplus } #endif diff --git a/src/main/exfile.c b/src/main/exfile.c index ee837a79d5c..49f2cb2f618 100644 --- a/src/main/exfile.c +++ b/src/main/exfile.c @@ -475,30 +475,3 @@ int exfile_close(exfile_t *ef, REQUEST *request, int fd) fr_strerror_printf("Attempt to unlock file which is not tracked"); return -1; } - -/** Unlock the file, but leave the dup'd file descriptor open - * - */ -int exfile_unlock(exfile_t *ef, REQUEST *request, int fd) -{ - uint32_t i; - - for (i = 0; i < ef->max_entries; i++) { - if (!ef->entries[i].filename) continue; - - if (ef->entries[i].dup == fd) { - ef->entries[i].dup = -1; - - pthread_mutex_unlock(&(ef->mutex)); - - exfile_trigger_exec(ef, request, &ef->entries[i], "release"); - - return 0; - } - } - - pthread_mutex_unlock(&(ef->mutex)); - - fr_strerror_printf("Attempt to unlock file which does not exist"); - return -1; -}