view libpurple/protocols/zephyr/ZClosePort.c @ 24963:36897ddd3e08

This should prevent the crash in #8109 by stopping an invalid message from getting in the queue. There is still a problem farther up from here in that an invalid message shouldn't get this far - hopefully this will help track it down by providing a message at the time the issue happens instead of crashing later. Fixes #8109.
author Daniel Atallah <daniel.atallah@gmail.com>
date Thu, 15 Jan 2009 03:54:58 +0000
parents 5fe8042783c1
children a8cc50c2279f
line wrap: on
line source

/* This file is part of the Project Athena Zephyr Notification System.
 * It contains source for the ZClosePort function.
 *
 *	Created by:	Robert French
 *
 *	Copyright (c) 1987 by the Massachusetts Institute of Technology.
 *	For copying and distribution information, see the file
 *	"mit-copyright.h". 
 */

#include "internal.h"

Code_t ZClosePort()
{
    if (__Zephyr_fd >= 0 && __Zephyr_open)
	(void) close(__Zephyr_fd);

    __Zephyr_fd = -1;
    __Zephyr_open = 0;
	
    return (ZERR_NONE);
}