9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: David Swasey <swasey@cs.cmu.edu>
To: 9fans@cse.psu.edu
Subject: [9fans] manual suggestions and upas/fs bug
Date: Mon, 16 Sep 2002 15:29:32 -0400	[thread overview]
Message-ID: <c881c5b5ee53a0c999a0f53343a87bf1@cs.cmu.edu> (raw)

Hi,

The malloc(2) page says:

	The call realloc(0, size) means the same as `malloc(size)'.
	Further, the call realloc(ptr, 0) means the same as
	`free(ptr)'.

I suggest you clarify the meaning of realloc(0,0).

The manual pages filter(1), mail(1), marshal(1), mlmgr(1), nedmail(1),
upasfs(4), pop3(8), send(8), and smtp(8) refer to aliasmail(1) which
does not exist.  The file /sys/man/8/INDEX.html refers to aliasmail(8)
which exists.  I suggest you decide if its aliasmail(8) or
aliasmail(1) and make the appropriate changes.

Upas/fs dies when working with an empty IMAP4 mail box.  There are two
problems, both in /sys/src/cmd/upas/fs/imap4.c:/^imap4read.  First,
when imap->nmsg is 0, the erealloc() call will fail.  Second, the
IMAP4 server I talk to (cyrus) does not like the command "UID FETCH
1:* UID" when there are no messages.  My fix was to change the
semantics of erealloc(_,0) and to avoid the offending IMAP command.
Diffs follow.

-dave

diff /n/dump/2002/0916/sys/src/cmd/upas/fs/imap4.c imap4.c
557,559c557,561
< 	imap4cmd(imap, "UID FETCH 1:* UID");
< 	if(!isokay(s = imap4resp(imap)))
< 		return s;
---
> 	if(imap->nmsg > 0){
> 		imap4cmd(imap, "UID FETCH 1:* UID");
> 		if(!isokay(s = imap4resp(imap)))
> 			return s;
> 	}
diff /n/dump/2002/0916/sys/src/cmd/upas/fs/mbox.c mbox.c
1358c1358,1362
< 	p = realloc(p, n);
---
> 	if(n==0){
> 		free(p);
> 		p = malloc(n);
> 	} else
> 		p = realloc(p, n);



             reply	other threads:[~2002-09-16 19:29 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-16 19:29 David Swasey [this message]
2002-09-17  1:58 ` Lyndon Nerenberg
2002-09-17  8:47 ` Douglas A. Gwyn
2002-09-17  9:17   ` Lucio De Re
2002-09-18  8:37     ` Douglas A. Gwyn
2002-09-17  4:34 David Swasey
2002-09-17 20:18 ` Lyndon Nerenberg
2002-09-17  4:58 Russ Cox
2002-09-17 13:28 Russ Cox
2002-09-17 23:05 Russ Cox
2002-09-18  2:06 ` Lyndon Nerenberg
2002-09-18 17:03   ` rob pike, esq.

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c881c5b5ee53a0c999a0f53343a87bf1@cs.cmu.edu \
    --to=swasey@cs.cmu.edu \
    --cc=9fans@cse.psu.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).