Fix handle_opendir() in the sdcard daemon
The fuse_open_out structure returned to the kernel by handle_opendir()
was not properly initializing all the fields. The symptom was recursive
ls (ls -R) failing on the emulated sdcard filesystem, because rewinddir(3)
was failing with ESPIPE.
Bug: 7168594
Change-Id: I56ddfd3453e6aac34fe6e001e88c4c46fb2eb271
diff --git a/sdcard/sdcard.c b/sdcard/sdcard.c
index bff6e67..7e65a68 100644
--- a/sdcard/sdcard.c
+++ b/sdcard/sdcard.c
@@ -972,6 +972,8 @@
return -errno;
}
out.fh = ptr_to_id(h);
+ out.open_flags = 0;
+ out.padding = 0;
fuse_reply(fuse, hdr->unique, &out, sizeof(out));
return NO_STATUS;
}