home *** CD-ROM | disk | FTP | other *** search
/ back2roots/padua / padua.7z / padua / uucp / duucp-1.17 / AU-117b4-src.lha / src / lib / waitmsg.c < prev   
Encoding:
C/C++ Source or Header  |  1993-12-24  |  416 b   |  26 lines

  1. /*
  2.  *  WAITMSG.C
  3.  *
  4.  *  Wait for a message to be returned to its reply port then remove it
  5.  */
  6.  
  7. #include <exec/types.h>
  8. #include <exec/ports.h>
  9. #include <stdio.h>
  10. #include "config.h"
  11.  
  12. Prototype void WaitMsg (struct Message *);
  13.  
  14. void
  15. WaitMsg (struct Message *msg)
  16. {
  17.     while (msg->mn_Node.ln_Type != NT_REPLYMSG)
  18.         Wait (1 << msg->mn_ReplyPort->mp_SigBit);
  19.  
  20.     Forbid ();
  21.     Remove (&msg->mn_Node);
  22.     Permit ();
  23.  
  24.     return;
  25. }
  26.