Skip to content

Commit 6ea33a5

Browse files
committed
Fixed posix build, CORE-2917
1 parent 1ee74f5 commit 6ea33a5

3 files changed

Lines changed: 25 additions & 1 deletion

File tree

configure.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -646,6 +646,7 @@ AC_CHECK_HEADERS(semaphore.h)
646646
AC_CHECK_HEADERS(float.h)
647647
AC_CHECK_HEADERS(atomic.h)
648648
AC_CHECK_HEADERS(atomic_ops.h)
649+
AC_CHECK_HEADERS(utime.h)
649650

650651
dnl Check for libraries
651652
AC_SEARCH_LIBS(dlopen, dl)

src/jrd/os/posix/os_utils.cpp

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@
5959
#include <pwd.h>
6060
#endif
6161

62+
#ifdef HAVE_UTIME_H
63+
#include <utime.h>
64+
#endif
65+
6266
namespace os_utils
6367
{
6468

@@ -187,4 +191,23 @@ int openCreateSharedFile(const char* pathname, int flags)
187191
return fd;
188192
}
189193

194+
// set file's last access and modification time to current time
195+
bool touchFile(const char* pathname)
196+
{
197+
#ifdef HAVE_UTIME_H
198+
while (utime(pathname, NULL) < 0)
199+
{
200+
if (SYSCALL_INTERRUPTED(errno))
201+
{
202+
continue;
203+
}
204+
return false;
205+
}
206+
207+
return true;
208+
#else
209+
return false;
210+
#endif
211+
}
212+
190213
} // namespace os_utils

src/jrd/trace/TraceConfigStorage.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
#include "../../common/classes/init.h"
3434
#include "../../common/classes/semaphore.h"
3535
#include "../../jrd/isc.h"
36-
#include "../../jrd/threaddata.h"
36+
#include "../../jrd/ThreadData.h"
3737
#include "../../jrd/trace/TraceSession.h"
3838

3939
namespace Jrd {

0 commit comments

Comments
 (0)