1997-04-26 17:21:57 +04:00
|
|
|
/*
|
|
|
|
* getversion.c - Get a file version on an ext2 file system
|
|
|
|
*
|
|
|
|
* Copyright (C) 1993, 1994 Remy Card <card@masi.ibp.fr>
|
|
|
|
* Laboratoire MASI, Institut Blaise Pascal
|
|
|
|
* Universite Pierre et Marie Curie (Paris VI)
|
|
|
|
*
|
2010-05-18 05:31:56 +04:00
|
|
|
* %Begin-Header%
|
|
|
|
* This file may be redistributed under the terms of the GNU Library
|
|
|
|
* General Public License, version 2.
|
|
|
|
* %End-Header%
|
1997-04-26 17:21:57 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* History:
|
|
|
|
* 93/10/30 - Creation
|
|
|
|
*/
|
|
|
|
|
1997-04-26 17:58:21 +04:00
|
|
|
#if HAVE_ERRNO_H
|
1997-04-26 17:21:57 +04:00
|
|
|
#include <errno.h>
|
1997-04-26 17:58:21 +04:00
|
|
|
#endif
|
1997-04-26 17:21:57 +04:00
|
|
|
#include <sys/ioctl.h>
|
|
|
|
|
|
|
|
#include "e2p.h"
|
|
|
|
|
|
|
|
int getversion (int fd, unsigned long * version)
|
|
|
|
{
|
1997-04-26 17:58:21 +04:00
|
|
|
#if HAVE_EXT2_IOCTLS
|
1998-03-09 16:07:09 +03:00
|
|
|
int r, ver;
|
2008-08-28 07:07:54 +04:00
|
|
|
|
1998-03-09 16:07:09 +03:00
|
|
|
r = ioctl (fd, EXT2_IOC_GETVERSION, &ver);
|
|
|
|
*version = ver;
|
ChangeLog, e2fsck.h, pass4.c, super.c:
super.c, e2fsck.h: Always declare e2fsck_get_device_size() as an
extern in e2fsck.h to prevent -Wall warnings.
pass4.c (e2fsck_pass4): Remove unused variable 'j'.
super.c (check_super_block): Fix broken superblock sanity check when
calculating blocks_per_group if s_log_frag_size != s_log_block_size.
Since we don't support fragments, this isn't a bug deal, but it's good
to get it fixed.
ChangeLog, Makefile.elf-lib:
Makefile.elf-lib (installdirs): Change use of DLL_INSTALL_DIR to
ELF_INSTALL_DIR. (Doesn't make a difference currently, but it's
correct this way.)
ChangeLog, fgetversion.c, getversion.c:
getversion.c (getversion): Return 0 if there's no error.
fgetversion.c (fgetversion): Pass the address of the temporary
variable instead of the unitialized variable to the
EXT2_IOC_GETVERSION ioctl.
1998-03-30 05:16:26 +04:00
|
|
|
return 0;
|
1997-04-26 17:58:21 +04:00
|
|
|
#else /* ! HAVE_EXT2_IOCTLS */
|
|
|
|
extern int errno;
|
|
|
|
errno = EOPNOTSUPP;
|
|
|
|
return -1;
|
|
|
|
#endif /* ! HAVE_EXT2_IOCTLS */
|
1997-04-26 17:21:57 +04:00
|
|
|
}
|