fixed build error under linux.

This commit is contained in:
Abdulaziz Ghuloum
2008-11-16 04:22:23 -05:00
parent bc11d4f44f
commit e3a7a875a4
5 changed files with 484 additions and 1 deletions
+19
View File
@@ -297,6 +297,7 @@ timespec_bytevector(struct timespec* s, ikpcb* pcb) {
return r + bytevector_tag;
}
ikptr
ikrt_file_ctime2(ikptr filename, ikpcb* pcb){
struct stat s;
@@ -304,7 +305,16 @@ ikrt_file_ctime2(ikptr filename, ikpcb* pcb){
if(err) {
return ik_errno_to_code();
}
#if HAVE_STAT_ST_CTIMESPEC
return timespec_bytevector(&s.st_ctimespec, pcb);
#elif HAVE_STAT_ST_CTIM
return timespec_bytevector(&s.st_ctim, pcb);
#else
struct timespec ts;
ts.tv_sec = s.st_ctime;
ts.tv_nsec = 0;
return timespec_bytevector(&st, pcb);
#endif
}
ikptr
@@ -314,7 +324,16 @@ ikrt_file_mtime2(ikptr filename, ikpcb* pcb){
if(err) {
return ik_errno_to_code();
}
#if HAVE_STAT_ST_MTIMESPEC
return timespec_bytevector(&s.st_mtimespec, pcb);
#elif HAVE_STAT_ST_MTIM
return timespec_bytevector(&s.st_mtim, pcb);
#else
struct timespec ts;
ts.tv_sec = s.st_mtime;
ts.tv_nsec = 0;
return timespec_bytevector(&st, pcb);
#endif
}