/*
- * $Id: dsi_tickle.c,v 1.8 2009-10-25 06:13:11 didg Exp $
*
* Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu)
* All rights reserved. See COPYRIGHT.
#include <signal.h>
#include <atalk/dsi.h>
-#include <netatalk/endian.h>
/* server generated tickles. as this is only called by the tickle handler,
* we don't need to block signals. */
int dsi_tickle(DSI *dsi)
{
char block[DSI_BLOCKSIZ];
- u_int16_t id;
- int ret;
+ uint16_t id;
- if (dsi->asleep || dsi->in_write)
+ if ((dsi->flags & DSI_SLEEPING) || dsi->in_write)
return 1;
id = htons(dsi_serverID(dsi));
memcpy(block + 2, &id, sizeof(id));
/* code = len = reserved = 0 */
- ret = dsi_stream_write(dsi, block, DSI_BLOCKSIZ, DSI_NOWAIT);
- /* we don't really care if we can't send a tickle, it will fail
- * elsewhere
- */
- ret = (ret == -1 || ret == DSI_BLOCKSIZ);
- return ret;
+ return dsi_stream_write(dsi, block, DSI_BLOCKSIZ, DSI_NOWAIT);
}