db2_local: replace timelocal() with mktime()
authorDaniel-Constantin Mierla <miconda@gmail.com>
Mon, 27 Apr 2020 07:00:21 +0000 (09:00 +0200)
committerDaniel-Constantin Mierla <miconda@gmail.com>
Mon, 27 Apr 2020 07:00:21 +0000 (09:00 +0200)
- timelocal() is nonstandard GNU extension, not recommended to be used
and mktime() should be equivalent:
  * https://linux.die.net/man/3/timegm
- GH #2298

src/modules/db2_ldap/ld_fld.c

index 867c873..7af731f 100644 (file)
@@ -270,7 +270,7 @@ static inline int ldap_gentime2db_datetime(time_t* dst, str* src)
                 * of expiration by one hour when daylight saving is used
                 */
                time.tm_isdst = -1;
-               *dst = timelocal(&time);
+               *dst = mktime(&time);
        }
        
        return 0;