Commit graph

13 commits

Author SHA1 Message Date
Andrey Borzenkov
5ef569df5b Use _W64 to detect MinGW W64-32 instead of _FILE_OFFSET_BITS
In 94cee4a4c2 I overlooked that config.h
unconditionally sets _FILE_OFFSET_BITS, so it cannot be used to detect
MinGW W64 environment. It looks like Emacs folks already found
solution; instead of _FILE_OFFSET_BITS use _W64 as suggested in
http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00723.html
2014-01-18 20:04:11 +04:00
Andrey Borzenkov
94cee4a4c2 fix 32 bit compilation on MinGW-w64
Use _FILE_OFFSET_BITS macro to distinguish between native MinGW and
32 bit under MinGW-64. The latter does not require fseeko/ftello
redefinition which it already does in case of _FILE_OFFSET_BITS=64.
2014-01-07 18:44:51 +04:00
Vladimir Serbinenko
e5fa26e573 Make newly-created files other than grub.cfg world-readable. 2013-12-24 17:36:10 +01:00
Andrey Borzenkov
396311f0f6 consolidate grub_util_exec code
We need to hide "modprobe efivars" error output to avoid confusion. So
consolidate grub_util_exec_* into single function that can optionally redirect
all three standard descriptors and make all other functions compatibility
wrappers.

Also remove include/grub/osdep/exec_unix.h which does not appear to be used
anywhere.
2013-12-16 22:41:15 +04:00
Vladimir Serbinenko
4f9541226c Introduce grub_util_file_sync and use it instead of fsync(fileno(f)).
Fixes build for windows.
2013-11-27 14:13:50 +01:00
Vladimir Serbinenko
cd46aa6cef Rewrite grub-install, grub-mkrescue, grub-mkstandalone and grub-mknetdir
the function of these files exceeds what can be sanely handled in shell
	in posix-comaptible way. Also writing it in C extends the functionality
	to non-UNIX-like OS and minimal environments.
2013-11-16 20:21:16 +01:00
Vladimir 'phcoder' Serbinenko
2028576504 Add haiku-specific functions. 2013-10-19 16:39:38 +02:00
Vladimir 'phcoder' Serbinenko
7b83ca449b * include/grub/osdep/hostfile_windows.h: Add missing ftello for
mingw32.
2013-10-15 20:32:07 +02:00
Vladimir 'phcoder' Serbinenko
4b4eeb3cc1 Allow compilation with mingw64 albeit with warnings due to lack of
%llx/%llu.

	* grub-core/gnulib/msvc-inval.c: Use __cdecl rather than cdecl.
	* grub-core/lib/posix_wrap/wchar.h: Define wint_t.
	* grub-core/lib/posix_wrap/wctype.h: Define wctype_t.
	* include/grub/osdep/hostfile_windows.h: Don't define fseeko/ftello
	on mingw64.
	* include/grub/types.h: Allow sizeof (long) != sizeof (void *).
2013-10-15 18:03:19 +02:00
Vladimir 'phcoder' Serbinenko
f6a81f0aaf Add wrappers around rename, unlink, mkdir, opendir, readdir and
closedir to handle filename charset translation.
2013-10-15 14:11:34 +02:00
Vladimir 'phcoder' Serbinenko
6de292cb9b Define GRUB_UTIL_FD_O_* and always use them with grub_util_fd_open. 2013-10-14 02:11:59 +02:00
Vladimir 'phcoder' Serbinenko
84379b61d2 * include/grub/osdep/hostfile_windows.h (grub_util_utf8_to_tchar): Add
missing prototype.
	(grub_util_tchar_to_utf8): Likewise.
2013-10-14 02:09:38 +02:00
Vladimir 'phcoder' Serbinenko
761c718b52 Move OS-dependent file definitions to include/grub/osdep/hostfile*.h. 2013-10-09 08:20:20 +02:00