Commit Graph

24 Commits (dcb8e1fa0452a3d31b678351c2297ad0255d3e4b)

Author SHA1 Message Date
Theodore Ts'o f1644c324b Eliminate doubly defined _LARGEFILE_SOURCE warning
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-07-12 22:54:37 -04:00
Andreas Dilger 51050544b5 blkid: remove unnecessary header and comment
The LIST_HEAD macro is not directly used in getsize.c, so
<sys/queue.h> is not needed at all, and could cause confusion at
some later point if the Linux-style list macros are ever used.

Build was verified on MacOS which defined HAVE_SYS_DISK_H true.
I manually inspected the sources for recent *BSD headers to check
if this was needed there or not.  MacOS and FreeBSD <sys/disk.h>
do not use lists at all.  NetBSD and OpenBSD <sys/disk.h> and all
of the <sys/mount.h> headers include <sys/queue.h> internally.

I used http://fxr.watson.org/fxr/source/sys/mount.h?v={OSTYPE}
as a reference, checking both old and new *BSD versions.

Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2014-07-04 23:59:45 -04:00
Andreas Dilger 45ff69ffeb build: quiet LLVM non-literal string format warning
Compiling with LLVM generates a large number of warnings due
to the use of _() for wrapping strings for i18n:

    warning: format string is not a string literal
          (potentially insecure) [-Wformat-security]
    ./nls-enable.h:4:14: note: expanded from macro '_'
    #define _(a) (gettext (a))
                 ^~~~~~~~~~~~

These warnings are fixed by using "%s" as the format string,
and then _() is used as the string argument.

Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2013-12-15 22:12:16 -05:00
Andreas Dilger 3e554cc116 ext2fs, blkid: localize environment-specific variables
Restructure the ext2fs_get_device_size() and blkid_get_dev_size()
code to localize the variables used for different device probing
methods.  This at least reduces the #ifdef mess to only one part
of the code for each method, and avoids "unused variable" compiler
warnings added when variables are declared without being #ifdef'd.

Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2012-11-26 09:34:20 -05:00
Andreas Dilger 7270fbe7fa build: fix compile warnings on OSX
Clean up some compile warnings related to fstat64(), which is
verbosely deprecated on OSX.

Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2012-02-27 01:28:23 -05:00
Theodore Ts'o d1154eb460 Shorten compile commands run by the build system
The DEFS line in MCONFIG had gotten so long that it exceeded 4k, and
this was starting to cause some tools heartburn.  It also made "make
V=1" almost useless, since trying to following the individual commands
run by make was lost in the noise of all of the defines.

So fix this by putting the configure-generated defines in lib/config.h
and the directory pathnames to lib/dirpaths.h.

In addition, clean up some vestigal defines in configure.in and in the
Makefiles to further shorten the cc command lines.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2011-09-18 17:34:37 -04:00
Theodore Ts'o efc6f628e1 Remove trailing whitespace for the entire source tree
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-08-27 23:07:54 -04:00
Theodore Ts'o a98b51e9dd Miscellaneous Cleanups
Signed-off-by: Andreas Dilger <adilger@clusterfs.com>
Signed-off-by: Girish Shilamkar <girish@clusterfs.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-08-03 20:10:46 -04:00
Andreas Dilger de8f3a7621 Fix gcc -Wall warnings, especially on 64-bit systems
Signed-off-by: Andreas Dilger <adilger@clusterfs.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-05-25 11:18:11 -04:00
Andreas Dilger 9a519c0284 fix comment for blkid_get_dev_size()
Signed-off-by: Andreas Dilger <adilger@clusterfs.com>
2006-06-21 00:04:08 -04:00
Matthias Andree a0dfc6ea8c Revise DIOCGDINFO (sys/disklabel.h) related FreeBSD comment.
Signed-off-by: Matthias Andree <matthias.andree@gmx.de>
2006-05-30 05:08:02 +02:00
Matthias Andree 5beaabb0f8 Enable sys/disklabel.h and DIOCGDINFO based getsize code.
Tested on FreeBSD 4.11-RELEASE i386.

Signed-off-by: Matthias Andree <matthias.andree@gmx.de>
2006-05-30 04:26:13 +02:00
Matthias Andree f72b8ff098 Implement DIOCGMEDIASIZE for FreeBSD's GEOM.
Try DIOCGMEDIASIZE ioctl() if defined, to obtain
the media size on FreeBSD 5.0 and newer.
The binary search fallback doesn't work, as FreeBSD
block devices are unbuffered and refuse reads below
the block size.

Signed-off-by: Matthias Andree <matthias.andree@gmx.de>
2006-05-30 00:54:49 +02:00
Andreas Dilger 9b7d811dda This patch adds a check to use fstat or fstat64 in getsize.c if the
target is a regular file, instead of doing binary searching.  It also
fixes a couple of cases where a file descriptor is leaked in the
ext2fs_getsize() routine on error.

Signed-off-by: Andreas Dilger <adilger@clusterfs.com>
2005-07-09 22:06:59 -05:00
Theodore Ts'o b22ea17742 getsize.c (blkid_get_dev_size): Fix compilation problem on
Darwin systems.
2005-03-16 23:38:14 -05:00
Matthias Andree f892826b8d lib/blkid/getsize.c: Move #include "blkidP.h" before <sys/queues.h>
to avoid a clash with the LIST_HEAD in the latter file that results
in compilation failure.
2005-01-13 04:15:45 +01:00
Theodore Ts'o 9845cf5dbd Clean up the header file #include's for lib/blkid/getsize.c
and lib/ext2fs/getsize.c

In lib/blkid/getsize.c, include <sys/disk.h> if present since
this is where the DIOCGMEDIASIZE ioctl is defined on FreeBSD.
(Addresses Debian Bug #264630)
2004-09-17 19:07:03 -04:00
Theodore Ts'o 1cdb6f7602 Don't close the file descriptor when determining the size.
This bug was introduced in the previous getsize changes, 
and was screwing up the blkid library probe functions.
(Addresses Debian Bug #239191)
2004-03-21 20:16:19 -05:00
Theodore Ts'o 2c5cfbcb99 Only use the BLKGETSIZE64 ioctl on Linux 2.6 since it is
unreliable in Linux 2.4.  (Addresses Debian Bug #236528).  

Fix typo in the ioctl used for Mac OS X.
2004-03-08 14:12:09 -05:00
Theodore Ts'o 85b8700344 Update getsize functions to use the Apple Darwin and Linux 64-bit
ioctl's.
2004-03-02 10:11:11 -05:00
Theodore Ts'o 0faabe5dea getsize.c: #include stat.h for the Apple Darwin port 2003-03-30 23:08:32 -05:00
Theodore Ts'o aa75ecccab Fix the Apple Darwin port. 2003-03-17 10:01:22 -05:00
Theodore Ts'o 7a603aa89f Separate public and private interfaces into separate header files.
Start separating internal implementation details from the
publically exported interface of the blkid library.
2003-01-26 01:54:39 -05:00
Theodore Ts'o e12f2ae74c Integrate new blkid library. 2003-01-23 16:45:16 -05:00