MSVC does not know wstat(). Instead _wstat() must be used here.
Unfortunately _wstat() takes a 'struct _stat'. A type 'stat_t' is
introduced to handle this situation in a portable way.
[v2: Use openvpn_stat_t instead of stat_t (David Sommerseth)]
Signed-off-by: Heiko Hund <heiko.hund@sophos.com>
Signed-off-by: David Sommerseth <davids@redhat.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
#endif
#ifdef WIN32
-int openvpn_stat (const char *path, struct stat *buf);
+typedef struct _stat openvpn_stat_t;
+int openvpn_stat (const char *path, openvpn_stat_t *buf);
#else
+typedef struct stat openvpn_stat_t;
static inline int
-openvpn_stat (const char *path, struct stat *buf)
+openvpn_stat (const char *path, openvpn_stat_t *buf)
{
return stat (path, buf);
}
&& c->c2.pf.filename
&& event_timeout_trigger (&c->c2.pf.reload, &c->c2.timeval, ETT_DEFAULT))
{
- struct stat s;
+ openvpn_stat_t s;
if (!openvpn_stat (c->c2.pf.filename, &s))
{
if (s.st_mtime > c->c2.pf.file_last_mod)
}
int
-openvpn_stat (const char *path, struct stat *buf)
+openvpn_stat (const char *path, openvpn_stat_t *buf)
{
struct gc_arena gc = gc_new ();
- int res = wstat (wide_string (path, &gc), buf);
+ int res = _wstat (wide_string (path, &gc), buf);
gc_free (&gc);
return res;
}