Skip to content

Commit d20ac73

Browse files
committed
twrp: Fix error printing
1 parent 7ee6f12 commit d20ac73

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

TWRP/META-INF/com/google/android/update-binary

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ unzip -o "$3" fixbootableimage -d /tmp/
2727
[ -e "/tmp/fixbootableimage" ] || abort "Failed to extract binary"
2828
chmod +x /tmp/fixbootableimage
2929

30-
/tmp/fixbootableimage "$BOOTIMAGE" > /tmp/log.txt
30+
/tmp/fixbootableimage "$BOOTIMAGE" > /tmp/log.txt 2>&1
3131
code=$?
3232
while read -r line; do
3333
ui_print "[*] $line"

TWRP/fixbootableimage

-184 Bytes
Binary file not shown.

TWRP/fixbootableimage.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,13 @@ void abortf(int code, const char *fmt, ...) {
7878
va_end(args);
7979
}
8080

81-
if (errno) perror("Error");
81+
// if (errno) perror("Last error");
8282
exit(code);
8383
}
8484

8585
int main(int argc, char ** argv) {
86+
setvbuf(stdout, NULL, _IOLBF, 0);
87+
setvbuf(stderr, NULL, _IOLBF, 0);
8688
if (argc != 2)
8789
abortf(1, "Usage: %s <boot.img>", argv[0]);
8890

0 commit comments

Comments
 (0)