diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2010-02-17 23:19:21 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2010-02-17 23:19:21 +0200 |
commit | bb3a903e6c9e590ba8397219255d399c99621042 (patch) | |
tree | 6d3fcfe0bb3ec4b65009c34382a014a6539eeef2 | |
parent | f9766e22019f9d1fa51351b339b75137450be73f (diff) | |
download | mailutils-bb3a903e6c9e590ba8397219255d399c99621042.tar.gz mailutils-bb3a903e6c9e590ba8397219255d399c99621042.tar.bz2 |
Bugfix
* libproto/mbox/mbox.c (mbox_append_message): Fix qid calculation.
-rw-r--r-- | libproto/mbox/mbox.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/libproto/mbox/mbox.c b/libproto/mbox/mbox.c index d073c02ee..826098d04 100644 --- a/libproto/mbox/mbox.c +++ b/libproto/mbox/mbox.c @@ -1263,7 +1263,7 @@ mbox_append_message (mu_mailbox_t mailbox, mu_message_t msg) { int status = 0; mbox_data_t mud = mailbox->data; - mu_off_t size; + mu_off_t qid; if (msg == NULL || mud == NULL) return EINVAL; @@ -1284,9 +1284,11 @@ mbox_append_message (mu_mailbox_t mailbox, mu_message_t msg) default: { + mu_off_t size; /* Move to the end of the file, not necesary if _APPEND mode. */ if ((status = mu_stream_size (mailbox->stream, &size)) != 0 - || (status = mbox_append_message0 (mailbox, msg, + || (qid = size, + status = mbox_append_message0 (mailbox, msg, &size, 0, 0)) != 0) { if (status != EAGAIN) @@ -1300,7 +1302,7 @@ mbox_append_message (mu_mailbox_t mailbox, mu_message_t msg) if (mailbox->observable) { char *buf = NULL; - mu_asprintf (&buf, "%lu", (unsigned long) size); + mu_asprintf (&buf, "%lu", (unsigned long) qid); mu_observable_notify (mailbox->observable, MU_EVT_MESSAGE_APPEND, buf); free (buf); } |