diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-21 04:59:33 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-21 04:59:33 +0000 |
commit | 73193347133e750faf27f88fd3ab31ce43aff062 (patch) | |
tree | e28a6d9512d1787b1fcbe9167188c9d134bf51d9 /lib/blkid | |
parent | Adding upstream version 1.47.0. (diff) | |
download | e2fsprogs-73193347133e750faf27f88fd3ab31ce43aff062.tar.xz e2fsprogs-73193347133e750faf27f88fd3ab31ce43aff062.zip |
Adding upstream version 1.47.1.upstream/1.47.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'lib/blkid')
-rw-r--r-- | lib/blkid/Android.bp | 3 | ||||
-rw-r--r-- | lib/blkid/blkidP.h | 7 | ||||
-rw-r--r-- | lib/blkid/read.c | 9 |
3 files changed, 15 insertions, 4 deletions
diff --git a/lib/blkid/Android.bp b/lib/blkid/Android.bp index 891c74a..89e39ab 100644 --- a/lib/blkid/Android.bp +++ b/lib/blkid/Android.bp @@ -38,6 +38,9 @@ cc_library { shared_libs: ["libext2_uuid"], target: { + darwin: { + enabled: true, + }, windows: { enabled: true, }, diff --git a/lib/blkid/blkidP.h b/lib/blkid/blkidP.h index b3fe4a6..dad8bfb 100644 --- a/lib/blkid/blkidP.h +++ b/lib/blkid/blkidP.h @@ -23,9 +23,12 @@ #endif #include <blkid/blkid.h> - #include <blkid/list.h> +#ifdef __cplusplus +extern "C" { +#endif + #ifdef __GNUC__ #define __BLKID_ATTR(x) __attribute__(x) #else @@ -149,8 +152,10 @@ extern char *blkid_strndup(const char *s, const int length); #include <stdio.h> extern int blkid_debug_mask; #define DBG(m,x) if ((m) & blkid_debug_mask) x; +#define INC_LINENO lineno++ #else #define DBG(m,x) +#define INC_LINENO #endif #ifdef CONFIG_BLKID_DEBUG diff --git a/lib/blkid/read.c b/lib/blkid/read.c index b894856..ad4f44f 100644 --- a/lib/blkid/read.c +++ b/lib/blkid/read.c @@ -382,7 +382,10 @@ void blkid_read_cache(blkid_cache cache) { FILE *file; char buf[4096]; - int fd, lineno = 0; + int fd; +#ifdef CONFIG_BLKID_DEBUG + int lineno = 0; +#endif struct stat st; if (!cache) @@ -414,7 +417,7 @@ void blkid_read_cache(blkid_cache cache) blkid_dev dev; unsigned int end; - lineno++; + INC_LINENO; if (buf[0] == 0) continue; end = strlen(buf) - 1; @@ -422,7 +425,7 @@ void blkid_read_cache(blkid_cache cache) while (buf[end] == '\\' && end < sizeof(buf) - 2 && fgets(buf + end, sizeof(buf) - end, file)) { end = strlen(buf) - 1; - lineno++; + INC_LINENO; } if (blkid_parse_line(cache, &dev, buf) < 0) { |