1
1

* configure.in: Use AC_CHECK_MEMBERS to check fields of struct

stat.  Adjust all dependencies.
Этот коммит содержится в:
Pavel Roskin 2003-10-29 17:36:16 +00:00
родитель cea13079c3
Коммит 0ba019a90b
9 изменённых файлов: 20 добавлений и 18 удалений

Просмотреть файл

@ -1,5 +1,8 @@
2003-10-29 Pavel Roskin <proski@gnu.org>
* configure.in: Use AC_CHECK_MEMBERS to check fields of struct
stat. Adjust all dependencies.
* acinclude.m4 (AC_STRUCT_LINGER): Remove, use AC_CHECK_MEMBERS
instead.

Просмотреть файл

@ -167,9 +167,8 @@ AC_HEADER_DIRENT
AC_HEADER_STDC
dnl Missing structure components
AC_STRUCT_ST_BLKSIZE
AC_CHECK_MEMBERS([struct stat.st_blksize, struct stat.st_rdev])
AC_STRUCT_ST_BLOCKS
AC_STRUCT_ST_RDEV
dnl
dnl Check availability of some functions

Просмотреть файл

@ -150,7 +150,7 @@ info_show_info (struct WInfo *info)
case 8:
widget_move (&info->widget, 8, 3);
#if 0
#ifdef HAVE_ST_RDEV
#ifdef HAVE_STRUCT_STAT_ST_RDEV
if (st.st_rdev)
printw ("Inode dev: major: %d, minor: %d",
st.st_rdev >> 8, st.st_rdev & 0xff);
@ -161,7 +161,7 @@ info_show_info (struct WInfo *info)
char buffer[10];
size_trunc_len(buffer, 9, st.st_size, 0);
printw (_("Size: %s"), buffer);
#ifdef HAVE_ST_BLOCKS
#ifdef HAVE_STRUCT_STAT_ST_BLOCKS
printw ((st.st_blocks==1) ?
_(" (%d block)") : _(" (%d blocks)"), st.st_blocks);
#endif

Просмотреть файл

@ -201,7 +201,7 @@ string_file_size (file_entry *fe, int len)
return _("UP--DIR");
}
#ifdef HAVE_ST_RDEV
#ifdef HAVE_STRUCT_STAT_ST_RDEV
if (S_ISBLK (fe->st.st_mode) || S_ISCHR (fe->st.st_mode))
g_snprintf (buffer, sizeof (buffer), "%3d,%3d",
(int) ((fe->st.st_rdev >> 8) & 0xff),

Просмотреть файл

@ -365,7 +365,7 @@ extfs_read_archive (int fstype, const char *name, struct archive **pparc)
inode->dev = current_archive->rdev;
inode->archive = current_archive;
inode->mode = hstat.st_mode;
#ifdef HAVE_ST_RDEV
#ifdef HAVE_STRUCT_STAT_ST_RDEV
inode->rdev = hstat.st_rdev;
#else
inode->rdev = 0;
@ -921,14 +921,14 @@ static void extfs_stat_move( struct stat *buf, struct inode *inode )
buf->st_nlink = inode->nlink;
buf->st_uid = inode->uid;
buf->st_gid = inode->gid;
#ifdef HAVE_ST_RDEV
#ifdef HAVE_STRUCT_STAT_ST_RDEV
buf->st_rdev = inode->rdev;
#endif
buf->st_size = inode->size;
#ifdef HAVE_ST_BLKSIZE
#ifdef HAVE_STRUCT_STAT_ST_BLKSIZE
buf->st_blksize = RECORDSIZE;
#endif
#ifdef HAVE_ST_BLOCKS
#ifdef HAVE_STRUCT_STAT_ST_BLOCKS
buf->st_blocks = (inode->size + RECORDSIZE - 1) / RECORDSIZE;
#endif
buf->st_atime = inode->atime;

Просмотреть файл

@ -464,7 +464,7 @@ fish_dir_load(struct vfs_class *me, struct vfs_s_inode *dir, char *remote_path)
int maj, min;
if (sscanf(buffer+1, "%d,%d", &maj, &min) != 2)
break;
#ifdef HAVE_ST_RDEV
#ifdef HAVE_STRUCT_STAT_ST_RDEV
ST.st_rdev = (maj << 8) | min;
#endif
}

Просмотреть файл

@ -823,7 +823,7 @@ mcfs_get_stat_info (mcfs_connection *mc, struct stat *buf)
buf->st_dev = 0;
rpc_get (sock, RPC_INT, &mylong, RPC_END);
#ifdef HAVE_ST_RDEV
#ifdef HAVE_STRUCT_STAT_ST_RDEV
buf->st_rdev = mylong;
#endif
rpc_get (sock, RPC_INT, &mylong, RPC_END);
@ -841,7 +841,7 @@ mcfs_get_stat_info (mcfs_connection *mc, struct stat *buf)
if (!rpc_get (sock, RPC_INT, &mylong, RPC_END))
return 0;
#ifdef HAVE_ST_BLOCKS
#ifdef HAVE_STRUCT_STAT_ST_BLOCKS
buf->st_blocks = mylong;
#endif
buf->st_atime = mcfs_get_time (mc);

Просмотреть файл

@ -329,13 +329,13 @@ send_stat_info (struct stat *st)
{
long mylong;
int blocks =
#ifdef HAVE_ST_BLOCKS
#ifdef HAVE_STRUCT_STAT_ST_BLOCKS
st->st_blocks;
#else
st->st_size / 1024;
#endif
#ifdef HAVE_ST_RDEV
#ifdef HAVE_STRUCT_STAT_ST_RDEV
mylong = st->st_rdev;
#else
mylong = 0;

Просмотреть файл

@ -1702,7 +1702,7 @@ vfs_parse_ls_lga (const char *p, struct stat *s, char **filename, char **linknam
if (!is_num (++idx2) || sscanf(columns [idx2], " %d", &min) != 1)
goto error;
#ifdef HAVE_ST_RDEV
#ifdef HAVE_STRUCT_STAT_ST_RDEV
s->st_rdev = ((maj & 0xff) << 8) | (min & 0xffff00ff);
#endif
s->st_size = 0;
@ -1713,7 +1713,7 @@ vfs_parse_ls_lga (const char *p, struct stat *s, char **filename, char **linknam
goto error;
s->st_size = (size_t) atol (columns [idx2]);
#ifdef HAVE_ST_RDEV
#ifdef HAVE_STRUCT_STAT_ST_RDEV
s->st_rdev = 0;
#endif
}
@ -1724,10 +1724,10 @@ vfs_parse_ls_lga (const char *p, struct stat *s, char **filename, char **linknam
/* Use resulting time value */
s->st_atime = s->st_ctime = s->st_mtime;
/* s->st_dev and s->st_ino must be initialized by vfs_s_new_inode () */
#ifdef HAVE_ST_BLKSIZE
#ifdef HAVE_STRUCT_STAT_ST_BLKSIZE
s->st_blksize = 512;
#endif
#ifdef HAVE_ST_BLOCKS
#ifdef HAVE_STRUCT_STAT_ST_BLOCKS
s->st_blocks = (s->st_size + 511) / 512;
#endif