fixed minor building issues.

renamed sys::getpgrp to sys::getpgid
This commit is contained in:
2015-03-19 14:07:50 +00:00
parent e0d36803cc
commit 8d1704c0a4
8 changed files with 75 additions and 20 deletions

View File

@ -194,7 +194,7 @@ int qse_fmtfltmaxtombs (qse_mchar_t* buf, qse_size_t bufsize, qse_fltmax_t f, qs
if (len + 1 < bufsize)
{
buf[len++] = point; // add decimal point to string
buf[len++] = point; /* add decimal point to string */
buf[len] = QSE_MT('\0');
}

View File

@ -237,7 +237,7 @@ static int copy_file_in_fs (qse_fs_t* fs, cpfile_t* cpfile)
if (cpfile->flags & QSE_FS_CPFILE_PRESERVE)
{
#if defined(HAVE_FUTIMENS)
#if defined(HAVE_FUTIMENS) && defined(HAVE_STRUCT_TIMESPEC)
struct timespec ts[2];
#elif defined(HAVE_FUTIMES)
struct timeval tv[2];
@ -254,7 +254,7 @@ static int copy_file_in_fs (qse_fs_t* fs, cpfile_t* cpfile)
goto oops;
}
#if defined(HAVE_FUTIMENS)
#if defined(HAVE_FUTIMENS) && defined(HAVE_STRUCT_TIMESPEC)
QSE_MEMSET (&ts, 0, QSE_SIZEOF(ts));
ts[0].tv_sec = cpfile->src_attr.atime.sec;

View File

@ -645,7 +645,7 @@ qse_fs_ent_t* qse_fs_read (qse_fs_t* fs, int flags)
if (flags & QSE_FS_ENT_TYPE)
{
#if defined(HAVE_STRUCT_DIRENT_D_TYPE)
#if defined(HAVE_STRUCT_DIRENT_D_TYPE) && defined(DT_DIR) && defined(DT_REG) /* and more */
switch (ent->d_type)
{
case DT_DIR:
@ -678,18 +678,26 @@ qse_fs_ent_t* qse_fs_read (qse_fs_t* fs, int flags)
default:
fs->ent.type = QSE_FS_ENT_UNKNOWN;
break;
}
}
#else
#if defined(__S_IFMT) && !defined(S_IFMT)
# define S_IFMT __S_IFMT
#endif
#if defined(__S_IFDIR) && !defined(S_IFDIR)
# define S_IFDIR __S_IFDIR
#endif
#define IS_TYPE(st,type) ((st.st_mode & S_IFMT) == S_IFDIR)
fs->ent.type = IS_TYPE(st,S_IFDIR)? QSE_FS_ENT_SUBDIR:
IS_TYPE(st,S_IFREG)? QSE_FS_ENT_REGULAR:
IS_TYPE(st,S_IFLNK)? QSE_FS_ENT_SYMLINK:
IS_TYPE(st,S_IFCHR)? QSE_FS_ENT_CHRDEV:
IS_TYPE(st,S_IFBLK)? QSE_FS_ENT_BLKDEV:
IS_TYPE(st,S_IFIFO)? QSE_FS_ENT_PIPE:
IS_TYPE(st,S_IFSOCK)? QSE_FS_ENT_PIPE:
QSE_FS_ENT_UNKNOWN;
IS_TYPE(st,S_IFREG)? QSE_FS_ENT_REGULAR:
IS_TYPE(st,S_IFLNK)? QSE_FS_ENT_SYMLINK:
IS_TYPE(st,S_IFCHR)? QSE_FS_ENT_CHRDEV:
IS_TYPE(st,S_IFBLK)? QSE_FS_ENT_BLKDEV:
IS_TYPE(st,S_IFIFO)? QSE_FS_ENT_PIPE:
#if defined(S_IFSOCK)
IS_TYPE(st,S_IFSOCK)? QSE_FS_ENT_PIPE:
#endif
QSE_FS_ENT_UNKNOWN;
#undef IS_TYPE
#endif
fs->ent.flags |= QSE_FS_ENT_TYPE;