diff options
Diffstat (limited to 'adb/remount_service.c')
-rw-r--r-- | adb/remount_service.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/adb/remount_service.c b/adb/remount_service.c index 4cb41e7..ad61284 100644 --- a/adb/remount_service.c +++ b/adb/remount_service.c @@ -72,6 +72,8 @@ static char *find_mount(const char *dir) static int remount_system() { char *dev; + int fd; + int OFF = 0; if (system_ro == 0) { return 0; @@ -82,6 +84,13 @@ static int remount_system() if (!dev) return -1; + fd = unix_open(dev, O_RDONLY); + if (fd < 0) + return -1; + + ioctl(fd, BLKROSET, &OFF); + adb_close(fd); + system_ro = mount(dev, "/system", "none", MS_REMOUNT, NULL); free(dev); |