From 3a8768804ce4b4797359d5df03ec8897fe43de90 Mon Sep 17 00:00:00 2001 From: Ken Sumrall Date: Wed, 14 Aug 2013 20:02:13 -0700 Subject: [PATCH] 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 --- sdcard/sdcard.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sdcard/sdcard.c b/sdcard/sdcard.c index bff6e67d5..7e65a68c4 100644 --- a/sdcard/sdcard.c +++ b/sdcard/sdcard.c @@ -972,6 +972,8 @@ static int handle_opendir(struct fuse* fuse, struct fuse_handler* handler, 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; }