From c859cb1de0d624caa0779fb17d1a53766143136e Mon Sep 17 00:00:00 2001 From: Lukas Czerner Date: Thu, 15 Sep 2011 23:44:48 -0400 Subject: e2fsprogs: create open() and stat() helpers In many places we are using #ifdef HAVE_OPEN64 to determine if we can use open64() but that's ugly. This commit creates two new helpers ext2fs_open_file() for open() and ext2fs_stat() for stat(). Also we need new typedef ext2fs_struct_stat for struct stat. Signed-off-by: Lukas Czerner Signed-off-by: Theodore Ts'o --- resize/main.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'resize') diff --git a/resize/main.c b/resize/main.c index 28a49ba2..daa68c5b 100644 --- a/resize/main.c +++ b/resize/main.c @@ -256,11 +256,7 @@ int main (int argc, char ** argv) len = 2 * len; } -#ifdef HAVE_OPEN64 - fd = open64(device_name, O_RDWR); -#else - fd = open(device_name, O_RDWR); -#endif + fd = ext2fs_open_file(device_name, O_RDWR); if (fd < 0) { com_err("open", errno, _("while opening %s"), device_name); -- cgit v1.2.3