standards/61934: [PATCH] FreeBSD's mailx not completely
SUSv3-compliant
Mike Heffner
mheffner at vt.edu
Wed Feb 18 06:30:21 PST 2004
The following reply was made to PR standards/61934; it has been noted by GNATS.
From: Mike Heffner <mheffner at vt.edu>
To: Wartan Hachaturow <wart at tepkom.ru>
Cc: FreeBSD-gnats-submit at FreeBSD.org
Subject: Re: standards/61934: [PATCH] FreeBSD's mailx not completely SUSv3-compliant
Date: Wed, 18 Feb 2004 09:20:40 -0500 (EST)
On 18-Feb-2004 Wartan Hachaturow wrote:
| On Mon, Feb 09, 2004 at 12:59:59AM -0500, Mike Heffner wrote:
|
|> your modified setfile() should work in those cases as well. So, can you
|> modify setfile to return a more descriptive error code like in your
|> checkmail and use it instead for the -e option? Also, the fprintf that
|
| Well, if we're agreed on not printing "No mail for .." in -e case, then
| there's
| a problem with setfile usage, which prints that for other usage cases.
| Of
| course, I can add an additional flag to arguments, but.. Isn't it
| clearer to use another function?
Yes, something like this should do:
if (!eOption)
fprintf("No mail for...");
Duplicating the ~100 lines of code for setfile for this change and slight
change to the return code is really not a good idea, IMHO.
The only current uses of setfile() are:
cmd3.c:560: if (setfile(*argv) < 0)
extern.h:219:int setfile(char *);
lex.c:65:setfile(name)
main.c:250: if (setfile(ef) < 0)
Therefore, changing setfile to have a tri-state return value (< 0, 0, 1)
will still work in these cases that are simply testing for a failure.
Mike
--
Mike Heffner <mheffner@[acm.]vt.edu>
<mikeh at FreeBSD.org>
More information about the freebsd-standards
mailing list