Skip to content

Commit

Permalink
Fix e2fsdroid build with musl
Browse files Browse the repository at this point in the history
The e2fsdroid build fails with musl because config.h is not included
before ext2fs.h, which causes HAVE_SYS_TYPES_H not to be defined
resulting in a missing definition for dev_t.

Include config.h at the top of each .c file, and remove extra
config.h include from perms.h.

Bug: 190084016
Test: m USE_HOST_MUSL=true fastboot
Change-Id: I95b3fff3f10ba85c00ec049811dd6b5d412e5dd2
  • Loading branch information
colincross committed Aug 24, 2021
1 parent 24701ed commit 09c63d5
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion contrib/android/e2fsdroid.c
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#define _GNU_SOURCE

#include "config.h"
#include <stdio.h>
#include <getopt.h>
#include <string.h>
#include <unistd.h>
#include <limits.h>
#include <ext2fs/ext2fs.h>

#include "perms.h"
#include "base_fs.h"
Expand Down
1 change: 1 addition & 0 deletions contrib/android/perms.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#ifndef _GNU_SOURCE
# define _GNU_SOURCE //asprintf
#endif
#include "config.h"
#include "perms.h"
#include "support/nls-enable.h"
#include <time.h>
Expand Down
1 change: 0 additions & 1 deletion contrib/android/perms.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#ifndef ANDROID_PERMS_H
# define ANDROID_PERMS_H

# include "config.h"
# include <ext2fs/ext2fs.h>

typedef void (*fs_config_f)(const char *path, int dir,
Expand Down
3 changes: 2 additions & 1 deletion e2fsck/jfs_user.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
#ifndef _JFS_USER_H
#define _JFS_USER_H

#include "config.h"

#ifdef DEBUGFS
#include <stdio.h>
#include <stdlib.h>
Expand All @@ -27,7 +29,6 @@
/*
* Pull in the definition of the e2fsck context structure
*/
#include "config.h"
#include "e2fsck.h"
#endif

Expand Down

0 comments on commit 09c63d5

Please sign in to comment.