]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
use fr_time_t
authorAlan T. DeKok <aland@freeradius.org>
Wed, 8 Sep 2021 12:39:30 +0000 (08:39 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Wed, 8 Sep 2021 12:39:30 +0000 (08:39 -0400)
src/lib/server/exfile.c

index 901589ce48f7d0e95e0b3324d3f5986b3b0c5bf7..15dae0756fc824867734effec6972e32fe9403a3 100644 (file)
@@ -38,7 +38,7 @@
 typedef struct {
        int                     fd;                     //!< File descriptor associated with an entry.
        uint32_t                hash;                   //!< Hash for cheap comparison.
-       time_t                  last_used;              //!< Last time the entry was used.
+       fr_time_t               last_used;              //!< Last time the entry was used.
        dev_t                   st_dev;                 //!< device inode
        ino_t                   st_ino;                 //!< inode number
        char                    *filename;              //!< Filename.
@@ -48,7 +48,7 @@ typedef struct {
 struct exfile_s {
        uint32_t                max_entries;            //!< How many file descriptors we keep track of.
        uint32_t                max_idle;               //!< Maximum idle time for a descriptor.
-       time_t                  last_cleaned;
+       fr_time_t               last_cleaned;
        pthread_mutex_t         mutex;
        exfile_entry_t          *entries;
        bool                    locking;
@@ -284,7 +284,7 @@ int exfile_open(exfile_t *ef, request_t *request, char const *filename, mode_t p
        int i, tries, unused = -1, found = -1, oldest = -1;
        bool do_cleanup = false;
        uint32_t hash;
-       time_t now;
+       fr_time_t now;
        struct stat st;
 
        if (!ef || !filename) return -1;
@@ -305,7 +305,7 @@ int exfile_open(exfile_t *ef, request_t *request, char const *filename, mode_t p
         *      full string comparisons.
         */
        hash = fr_hash_string(filename);
-       now = time(NULL);
+       now = fr_time();
        unused = -1;
 
        pthread_mutex_lock(&ef->mutex);