diff --git a/ChangeLog b/ChangeLog index ac6462be4..9cf9420d1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2003-10-29 Pavel Roskin + * 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. diff --git a/configure.in b/configure.in index e0bdc70db..9cbd33303 100644 --- a/configure.in +++ b/configure.in @@ -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 diff --git a/src/info.c b/src/info.c index 4b95e8d5c..5cb247a94 100644 --- a/src/info.c +++ b/src/info.c @@ -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 diff --git a/src/screen.c b/src/screen.c index 4b4cc010c..6a869c198 100644 --- a/src/screen.c +++ b/src/screen.c @@ -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), diff --git a/vfs/extfs.c b/vfs/extfs.c index 8b09806fe..fb91bd21c 100644 --- a/vfs/extfs.c +++ b/vfs/extfs.c @@ -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; diff --git a/vfs/fish.c b/vfs/fish.c index c2e206167..3a453d2d5 100644 --- a/vfs/fish.c +++ b/vfs/fish.c @@ -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 } diff --git a/vfs/mcfs.c b/vfs/mcfs.c index a80ec3b6f..c549bbe23 100644 --- a/vfs/mcfs.c +++ b/vfs/mcfs.c @@ -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); diff --git a/vfs/mcserv.c b/vfs/mcserv.c index b81f5c4c1..c70d9495b 100644 --- a/vfs/mcserv.c +++ b/vfs/mcserv.c @@ -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; diff --git a/vfs/vfs.c b/vfs/vfs.c index 657179e18..638ff1365 100644 --- a/vfs/vfs.c +++ b/vfs/vfs.c @@ -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