Rev 3103 | Rev 3250 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3103 | Rev 3247 | ||
---|---|---|---|
Line 115... | Line 115... | ||
115 | return false; |
115 | return false; |
116 | 116 | ||
117 | entry.len = uint32_t_le2host(entry.len); |
117 | entry.len = uint32_t_le2host(entry.len); |
118 | 118 | ||
119 | switch (entry.type) { |
119 | switch (entry.type) { |
120 | case 0: |
120 | case TMPFS_NONE: |
121 | break; |
121 | break; |
122 | case 1: |
122 | case TMPFS_FILE: |
123 | fname = malloc(entry.len + 1); |
123 | fname = malloc(entry.len + 1); |
124 | if (fname == NULL) |
124 | if (fname == NULL) |
125 | return false; |
125 | return false; |
126 | 126 | ||
127 | node = (tmpfs_dentry_t *) ops->create(L_FILE); |
127 | node = (tmpfs_dentry_t *) ops->create(L_FILE); |
Line 159... | Line 159... | ||
159 | if (!tmpfs_blockread(phone, block, bufpos, buflen, pos, |
159 | if (!tmpfs_blockread(phone, block, bufpos, buflen, pos, |
160 | node->data, size)) |
160 | node->data, size)) |
161 | return false; |
161 | return false; |
162 | 162 | ||
163 | break; |
163 | break; |
164 | case 2: |
164 | case TMPFS_DIRECTORY: |
165 | fname = malloc(entry.len + 1); |
165 | fname = malloc(entry.len + 1); |
166 | if (fname == NULL) |
166 | if (fname == NULL) |
167 | return false; |
167 | return false; |
168 | 168 | ||
169 | node = (tmpfs_dentry_t *) ops->create(L_DIRECTORY); |
169 | node = (tmpfs_dentry_t *) ops->create(L_DIRECTORY); |
Line 193... | Line 193... | ||
193 | 193 | ||
194 | break; |
194 | break; |
195 | default: |
195 | default: |
196 | return false; |
196 | return false; |
197 | } |
197 | } |
198 | } while (entry.type != 0); |
198 | } while (entry.type != TMPFS_NONE); |
199 | 199 | ||
200 | return true; |
200 | return true; |
201 | } |
201 | } |
202 | 202 | ||
203 | bool tmpfs_restore(dev_handle_t dev) |
203 | bool tmpfs_restore(dev_handle_t dev) |