summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2016-11-29 11:13:04 +0200
committerSergey Poznyakoff <gray@gnu.org.ua>2016-11-29 11:13:04 +0200
commitc78ceb5d286ca8704b6ac358a9c44b9bbcd723d1 (patch)
treed5616b32e14f595bd882ff795ec631246b495365
parent6efafc3f28d24b6e31052263d1c8f154049e9f65 (diff)
downloadmailutils-c78ceb5d286ca8704b6ac358a9c44b9bbcd723d1.tar.gz
mailutils-c78ceb5d286ca8704b6ac358a9c44b9bbcd723d1.tar.bz2
Remove compatibility support for obsolete .mu-size
-rw-r--r--include/mailutils/sys/amd.h2
-rw-r--r--libmailutils/base/amd.c42
2 files changed, 2 insertions, 42 deletions
diff --git a/include/mailutils/sys/amd.h b/include/mailutils/sys/amd.h
index ca42c7b32..c90f5c152 100644
--- a/include/mailutils/sys/amd.h
+++ b/include/mailutils/sys/amd.h
@@ -48,8 +48,6 @@
#define _MU_AMD_PROP_SIZE "size"
#define _MU_AMD_PROP_FILE_NAME ".mu-prop"
-/* Legacy (2.x) size file name */
-#define _MU_AMD_SIZE_FILE_NAME ".mu-size"
struct _amd_data;
struct _amd_message
diff --git a/libmailutils/base/amd.c b/libmailutils/base/amd.c
index a811cd5db..95a6f0182 100644
--- a/libmailutils/base/amd.c
+++ b/libmailutils/base/amd.c
@@ -216,34 +216,6 @@ _amd_prop_store_off (struct _amd_data *amd, const char *name, mu_off_t val)
return mu_property_set_value (amd->prop, name, p, 1);
}
-/* Backward-compatible size file support */
-static int
-read_size_file (struct _amd_data *amd)
-{
- FILE *fp;
- int rc;
- char *name = mu_make_file_name (amd->name, _MU_AMD_SIZE_FILE_NAME);
- if (!name)
- return 1;
- fp = fopen (name, "r");
- if (fp)
- {
- unsigned long size;
- if (fscanf (fp, "%lu", &size) == 1)
- {
- rc = _amd_prop_store_off (amd, _MU_AMD_PROP_SIZE, size);
- }
- else
- rc = 1;
- fclose (fp);
- unlink (name);
- }
- else
- rc = 1;
- free (name);
- return rc;
-}
-
static int
_amd_prop_create (struct _amd_data *amd)
{
@@ -267,8 +239,7 @@ _amd_prop_create (struct _amd_data *amd)
free (mhprop->filename);
free (mhprop);
}
- else
- read_size_file (amd);
+
return rc;
}
@@ -1246,20 +1217,11 @@ amd_remove_mbox (mu_mailbox_t mailbox)
{
char *name;
- name = mu_make_file_name (amd->name, _MU_AMD_SIZE_FILE_NAME);
+ name = mu_make_file_name (amd->name, _MU_AMD_PROP_FILE_NAME);
if (!name)
return ENOMEM;
if (unlink (name) && errno != ENOENT)
rc = errno;
- else
- {
- free (name);
- name = mu_make_file_name (amd->name, _MU_AMD_PROP_FILE_NAME);
- if (!name)
- return ENOMEM;
- if (unlink (name) && errno != ENOENT)
- rc = errno;
- }
free (name);
}

Return to:

Send suggestions and report system problems to the System administrator.