Remove compatibility support for obsolete .mu-size
Showing
2 changed files
with
2 additions
and
42 deletions
... | @@ -48,8 +48,6 @@ | ... | @@ -48,8 +48,6 @@ |
48 | #define _MU_AMD_PROP_SIZE "size" | 48 | #define _MU_AMD_PROP_SIZE "size" |
49 | 49 | ||
50 | #define _MU_AMD_PROP_FILE_NAME ".mu-prop" | 50 | #define _MU_AMD_PROP_FILE_NAME ".mu-prop" |
51 | /* Legacy (2.x) size file name */ | ||
52 | #define _MU_AMD_SIZE_FILE_NAME ".mu-size" | ||
53 | 51 | ||
54 | struct _amd_data; | 52 | struct _amd_data; |
55 | struct _amd_message | 53 | struct _amd_message | ... | ... |
... | @@ -216,34 +216,6 @@ _amd_prop_store_off (struct _amd_data *amd, const char *name, mu_off_t val) | ... | @@ -216,34 +216,6 @@ _amd_prop_store_off (struct _amd_data *amd, const char *name, mu_off_t val) |
216 | return mu_property_set_value (amd->prop, name, p, 1); | 216 | return mu_property_set_value (amd->prop, name, p, 1); |
217 | } | 217 | } |
218 | 218 | ||
219 | /* Backward-compatible size file support */ | ||
220 | static int | ||
221 | read_size_file (struct _amd_data *amd) | ||
222 | { | ||
223 | FILE *fp; | ||
224 | int rc; | ||
225 | char *name = mu_make_file_name (amd->name, _MU_AMD_SIZE_FILE_NAME); | ||
226 | if (!name) | ||
227 | return 1; | ||
228 | fp = fopen (name, "r"); | ||
229 | if (fp) | ||
230 | { | ||
231 | unsigned long size; | ||
232 | if (fscanf (fp, "%lu", &size) == 1) | ||
233 | { | ||
234 | rc = _amd_prop_store_off (amd, _MU_AMD_PROP_SIZE, size); | ||
235 | } | ||
236 | else | ||
237 | rc = 1; | ||
238 | fclose (fp); | ||
239 | unlink (name); | ||
240 | } | ||
241 | else | ||
242 | rc = 1; | ||
243 | free (name); | ||
244 | return rc; | ||
245 | } | ||
246 | |||
247 | static int | 219 | static int |
248 | _amd_prop_create (struct _amd_data *amd) | 220 | _amd_prop_create (struct _amd_data *amd) |
249 | { | 221 | { |
... | @@ -267,8 +239,7 @@ _amd_prop_create (struct _amd_data *amd) | ... | @@ -267,8 +239,7 @@ _amd_prop_create (struct _amd_data *amd) |
267 | free (mhprop->filename); | 239 | free (mhprop->filename); |
268 | free (mhprop); | 240 | free (mhprop); |
269 | } | 241 | } |
270 | else | 242 | |
271 | read_size_file (amd); | ||
272 | return rc; | 243 | return rc; |
273 | } | 244 | } |
274 | 245 | ||
... | @@ -1246,20 +1217,11 @@ amd_remove_mbox (mu_mailbox_t mailbox) | ... | @@ -1246,20 +1217,11 @@ amd_remove_mbox (mu_mailbox_t mailbox) |
1246 | { | 1217 | { |
1247 | char *name; | 1218 | char *name; |
1248 | 1219 | ||
1249 | name = mu_make_file_name (amd->name, _MU_AMD_SIZE_FILE_NAME); | 1220 | name = mu_make_file_name (amd->name, _MU_AMD_PROP_FILE_NAME); |
1250 | if (!name) | 1221 | if (!name) |
1251 | return ENOMEM; | 1222 | return ENOMEM; |
1252 | if (unlink (name) && errno != ENOENT) | 1223 | if (unlink (name) && errno != ENOENT) |
1253 | rc = errno; | 1224 | rc = errno; |
1254 | else | ||
1255 | { | ||
1256 | free (name); | ||
1257 | name = mu_make_file_name (amd->name, _MU_AMD_PROP_FILE_NAME); | ||
1258 | if (!name) | ||
1259 | return ENOMEM; | ||
1260 | if (unlink (name) && errno != ENOENT) | ||
1261 | rc = errno; | ||
1262 | } | ||
1263 | free (name); | 1225 | free (name); |
1264 | } | 1226 | } |
1265 | 1227 | ... | ... |
-
Please register or sign in to post a comment