aboutsummaryrefslogtreecommitdiffstats
path: root/lib/e2p/fsetversion.c
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>1997-04-26 13:58:21 +0000
committerTheodore Ts'o <tytso@mit.edu>1997-04-26 13:58:21 +0000
commit50e1e10fa0ac12a3e2a9d20a75ee9041873cda96 (patch)
tree7ef931607cf258793edffa5deb1ddb1f46469d04 /lib/e2p/fsetversion.c
parentf3db3566b5e1342e49dffc5ec3f418a838584194 (diff)
downloadandroid_external_e2fsprogs-50e1e10fa0ac12a3e2a9d20a75ee9041873cda96.tar.gz
android_external_e2fsprogs-50e1e10fa0ac12a3e2a9d20a75ee9041873cda96.tar.bz2
android_external_e2fsprogs-50e1e10fa0ac12a3e2a9d20a75ee9041873cda96.zip
Many files:
Checked in e2fsprogs 0.5c
Diffstat (limited to 'lib/e2p/fsetversion.c')
-rw-r--r--lib/e2p/fsetversion.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/e2p/fsetversion.c b/lib/e2p/fsetversion.c
index 1bb8acca..afea3656 100644
--- a/lib/e2p/fsetversion.c
+++ b/lib/e2p/fsetversion.c
@@ -14,9 +14,13 @@
* 93/10/30 - Creation
*/
+#if HAVE_ERRNO_H
#include <errno.h>
-#include <fcntl.h>
+#endif
+#if HAVE_UNISTD_H
#include <unistd.h>
+#endif
+#include <fcntl.h>
#include <sys/ioctl.h>
#include <linux/ext2_fs.h>
@@ -25,6 +29,7 @@
int fsetversion (const char * name, unsigned long version)
{
+#if HAVE_EXT2_IOCTLS
int fd;
int r;
@@ -34,4 +39,9 @@ int fsetversion (const char * name, unsigned long version)
r = ioctl (fd, EXT2_IOC_SETVERSION, &version);
close (fd);
return r;
+#else /* ! HAVE_EXT2_IOCTLS */
+ extern int errno;
+ errno = EOPNOTSUPP;
+ return -1;
+#endif /* ! HAVE_EXT2_IOCTLS */
}