/*
- * $Id: dsi_tickle.c,v 1.5 2003-03-12 15:07:07 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. well, actually, we might get it during
- * a SIGHUP. */
+ * we don't need to block signals. */
int dsi_tickle(DSI *dsi)
{
char block[DSI_BLOCKSIZ];
- sigset_t oldset;
- u_int16_t id;
- int ret;
+ uint16_t id;
- if (dsi->asleep)
+ 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 */
- sigprocmask(SIG_BLOCK, &dsi->sigblockset, &oldset);
- ret = dsi_stream_write(dsi, block, DSI_BLOCKSIZ) == DSI_BLOCKSIZ;
- sigprocmask(SIG_SETMASK, &oldset, NULL);
- return ret;
+ return dsi_stream_write(dsi, block, DSI_BLOCKSIZ, DSI_NOWAIT);
}