1998Q1/
<!-- MHonArc v2.4.4 -->
<!--X-Subject: Re: [MUD&#45;Dev] Mail from mud Zoran's final Imp -->
<!--X-From-R13: Eunja Vnycraal <znynpunvNvanzr.pbz> -->
<!--X-Date: Fri, 02 Jan 1998 16:05:59 +0000 -->
<!--X-Message-Id: Pine.SUN.3.96.980102103313.3548A&#45;100000@sun38 -->
<!--X-Content-Type: text/plain -->
<!--X-Reference: 199801020044.AAA26292#out5,ibm.net -->
<!--X-Head-End-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>MUD-Dev message, Re: [MUD-Dev] Mail from mud Zoran's final Imp</title>
<!-- meta name="robots" content="noindex,nofollow" -->
<link rev="made" href="mailto:malachai#iname,com">
</head>
<body background="/backgrounds/paperback.gif" bgcolor="#ffffff"
      text="#000000" link="#0000FF" alink="#FF0000" vlink="#006000">

  <font size="+4" color="#804040">
    <strong><em>MUD-Dev<br>mailing list archive</em></strong>
  </font>
      
<br>
[&nbsp;<a href="../">Other Periods</a>
&nbsp;|&nbsp;<a href="../../">Other mailing lists</a>
&nbsp;|&nbsp;<a href="/search.php3">Search</a>
&nbsp;]
<br clear=all><hr>
<!--X-Body-Begin-->
<!--X-User-Header-->
<!--X-User-Header-End-->
<!--X-TopPNI-->

Date:&nbsp;
[&nbsp;<a href="msg00007.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00009.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Thread:&nbsp;
[&nbsp;<a href="msg00007.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00075.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Index:&nbsp;
[&nbsp;<A HREF="author.html#00008">Author</A>
&nbsp;|&nbsp;<A HREF="#00008">Date</A>
&nbsp;|&nbsp;<A HREF="thread.html#00008">Thread</A>
&nbsp;]

<!--X-TopPNI-End-->
<!--X-MsgBody-->
<!--X-Subject-Header-Begin-->
<H1>Re: [MUD-Dev] Mail from mud Zoran's final Imp</H1>
<HR>
<!--X-Subject-Header-End-->
<!--X-Head-of-Message-->
<UL>
<LI><em>To</em>: <A HREF="mailto:mud-dev#null,net">mud-dev#null,net</A></LI>
<LI><em>Subject</em>: Re: [MUD-Dev] Mail from mud Zoran's final Imp</LI>
<LI><em>From</em>: Shawn Halpenny &lt;<A HREF="mailto:malachai#iname,com">malachai#iname,com</A>&gt;</LI>
<LI><em>Date</em>: Fri, 2 Jan 1998 11:05:55 -0500 (EST)</LI>
<LI><em>Reply-To</em>: Shawn Halpenny &lt;<A HREF="mailto:malachai#iname,com">malachai#iname,com</A>&gt;</LI>
</UL>
<!--X-Head-of-Message-End-->
<!--X-Head-Body-Sep-Begin-->
<HR>
<!--X-Head-Body-Sep-End-->
<!--X-Body-of-Message-->
<PRE>
On Thu, 1 Jan 1998 coder#ibm,net wrote:

&gt; On 01/01/98 at 01:55 PM, Stephen Zepp &lt;zoran#enid,com&gt; said:
&gt; &gt;  sprintf( mailbuf, "mail -s \"%s\" %s &lt;%s%s",
&gt; &gt;     m_subject, m_address, MAIL_DIR, mfilename );
&gt; ...
&gt; &gt;  system( mailbuf );
&gt; &gt;  sprintf( delbuf, "rm %s%s", MAIL_DIR, mfilename );
&gt; &gt;  system( delbuf );
&gt; 
&gt; A lurking and insidious problem here is that you don't detect when mail
&gt; delivery fails.  This can be a bitch to a) notice when it happens, and b)
&gt; determine the cause when it does
&gt; 
&gt; I'd suggest putting in a signal handler which triggers on the child
&gt; dieing, and then reports an appropriate response to the user if the
&gt; delivery failed.  It's fairly trivial to do: you can use any of your
&gt; standard IPC calls to handle reporting the failure/success code (I do it
&gt; with threads instead of full processes via, so I do the report back via
&gt; the thread object for the mailer thread).

Isn't it easier to check the return value from system(), since the
wait() call inside system() is already waiting for the child to exit?
Checking whether it exited successfully, failed because of something
user-controllable, or died on some nasty signal is where the WIFxxxx
macros come in handy (see /usr/include/sys/wait.h).  Since you're
using system() instead of doing the fork() and exec() yourself,
remember that there can be a difference in the returned status if it
was the shell that was abnormally terminated instead of the command
process.

Also, the two system() calls can be done in one, if you (in pseudocode):
    system(mailbuf + ';' + delbuf);
(2 fork()s instead of 3...and provided your shell supports
multi-command command lines of that sort)

In any case, JC's right about the error reporting...especially with mail.

-- 
Shawn



</PRE>

<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<HR>
<ul compact><li><strong>Follow-Ups</strong>:
<ul>
<li><strong><A NAME="00075" HREF="msg00075.html">Re: [MUD-Dev] Mail from mud Zoran's final Imp</A></strong>
<ul compact><li><em>From:</em> JC Lawrence &lt;claw#under,Eng.Sun.COM&gt;</li></ul>
</UL></LI></UL>
<!--X-Follow-Ups-End-->
<!--X-References-->
<UL><LI><STRONG>References</STRONG>:
<UL>
<LI><STRONG><A NAME="00007" HREF="msg00007.html">Re: [MUD-Dev] Mail from mud Zoran's final Imp</A></STRONG>
<UL><LI><EM>From:</EM> coder#ibm,net</LI></UL></LI>
</UL></LI></UL>
<!--X-References-End-->
<!--X-BotPNI-->
<UL>
<LI>Prev by Date:
<STRONG><A HREF="msg00007.html">Re: [MUD-Dev] Mail from mud Zoran's final Imp</A></STRONG>
</LI>
<LI>Next by Date:
<STRONG><A HREF="msg00009.html">Re: [MUD-Dev]  Wild west (was Guilds &amp; Politics)</A></STRONG>
</LI>
<LI>Prev by thread:
<STRONG><A HREF="msg00007.html">Re: [MUD-Dev] Mail from mud Zoran's final Imp</A></STRONG>
</LI>
<LI>Next by thread:
<STRONG><A HREF="msg00075.html">Re: [MUD-Dev] Mail from mud Zoran's final Imp</A></STRONG>
</LI>
<LI>Index(es):
<UL>
<LI><A HREF="index.html#00008"><STRONG>Date</STRONG></A></LI>
<LI><A HREF="thread.html#00008"><STRONG>Thread</STRONG></A></LI>
</UL>
</LI>
</UL>

<!--X-BotPNI-End-->
<!--X-User-Footer-->
<!--X-User-Footer-End-->
<ul><li>Thread context:
<BLOCKQUOTE><UL>
<LI><STRONG>Re: [MUD-Dev]	The impact of the web on muds</STRONG>, <EM>(continued)</EM>
<ul compact>
<LI><strong><A NAME="00275" HREF="msg00275.html">Re: [MUD-Dev]	The impact of the web on muds</A></strong>, 
Chris Gray <a href="mailto:cg#ami-cg,GraySage.Edmonton.AB.CA">cg#ami-cg,GraySage.Edmonton.AB.CA</a>, Thu 22 Jan 1998, 07:05 GMT
<UL>
<LI><strong><A NAME="00281" HREF="msg00281.html">Re: [MUD-Dev] The impact of the web on muds</A></strong>, 
Shawn Halpenny <a href="mailto:malachai#iname,com">malachai#iname,com</a>, Thu 22 Jan 1998, 14:59 GMT
</LI>
</UL>
</LI>
</ul>
</LI>
<LI><strong><A NAME="00003" HREF="msg00003.html">Re: [MUD-Dev] Mail from mud Zoran's final Imp</A></strong>, 
Stephen Zepp <a href="mailto:zoran#enid,com">zoran#enid,com</a>, Thu 01 Jan 1998, 19:51 GMT
<UL>
<LI><strong><A NAME="00007" HREF="msg00007.html">Re: [MUD-Dev] Mail from mud Zoran's final Imp</A></strong>, 
coder <a href="mailto:coder#ibm,net">coder#ibm,net</a>, Fri 02 Jan 1998, 00:44 GMT
<UL>
<LI><strong><A NAME="00008" HREF="msg00008.html">Re: [MUD-Dev] Mail from mud Zoran's final Imp</A></strong>, 
Shawn Halpenny <a href="mailto:malachai#iname,com">malachai#iname,com</a>, Fri 02 Jan 1998, 16:05 GMT
<UL>
<LI><strong><A NAME="00075" HREF="msg00075.html">Re: [MUD-Dev] Mail from mud Zoran's final Imp</A></strong>, 
JC Lawrence <a href="mailto:claw#under,Eng.Sun.COM">claw#under,Eng.Sun.COM</a>, Wed 07 Jan 1998, 00:22 GMT
<UL>
<LI><strong><A NAME="00084" HREF="msg00084.html">Re: [MUD-Dev] Mail from mud Zoran's final Imp</A></strong>, 
Shawn Halpenny <a href="mailto:malachai#iname,com">malachai#iname,com</a>, Wed 07 Jan 1998, 14:50 GMT
</LI>
</UL>
</LI>
</UL>
</LI>
</UL>
</LI>
</UL>
</LI>
<LI><strong><A NAME="00002" HREF="msg00002.html">Re: [MUD-Dev]  Wild west (was Guilds &amp; Politics)</A></strong>, 
Jon A. Lambert <a href="mailto:jlsysinc#ix,netcom.com">jlsysinc#ix,netcom.com</a>, Thu 01 Jan 1998, 18:42 GMT
<UL>
<li>&lt;Possible follow-up(s)&gt;<br>
<LI><strong><A NAME="00009" HREF="msg00009.html">Re: [MUD-Dev]  Wild west (was Guilds &amp; Politics)</A></strong>, 
Mike Sellers <a href="mailto:mike#online-alchemy,com">mike#online-alchemy,com</a>, Fri 02 Jan 1998, 21:20 GMT
</LI>
</UL>
</LI>
</UL></BLOCKQUOTE>

</ul>
<hr>
<center>
[&nbsp;<a href="../">Other Periods</a>
&nbsp;|&nbsp;<a href="../../">Other mailing lists</a>
&nbsp;|&nbsp;<a href="/search.php3">Search</a>
&nbsp;]
</center>
<hr>
</body>
</html>