]> arthur.barton.de Git - netatalk.git/blobdiff - libatalk/dsi/dsi_attn.c
remove the need for blocking SIGALRM (still need to deal with attention volumes changed)
[netatalk.git] / libatalk / dsi / dsi_attn.c
index ae0883b6e0dcd2bd1304ef561bc12bbece12e25c..395ee1db940e73063a80819e05168438569ca0d8 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: dsi_attn.c,v 1.4 2002-12-04 10:59:37 didg Exp $
+ * $Id: dsi_attn.c,v 1.7 2009-10-22 04:59:50 didg Exp $
  *
  * Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu)
  * All rights reserved. See COPYRIGHT.
@@ -35,6 +35,9 @@ int dsi_attention(DSI *dsi, AFPUserBytes flags)
   u_int32_t len, nlen;
   u_int16_t id;
 
+  if (dsi->asleep || dsi->in_write)
+      return 1;
+      
   id = htons(dsi_serverID(dsi));
   flags = htons(flags);
   len = MIN(sizeof(flags), dsi->attn_quantum);
@@ -51,7 +54,7 @@ int dsi_attention(DSI *dsi, AFPUserBytes flags)
 
   /* send an attention */
   sigprocmask(SIG_BLOCK, &dsi->sigblockset, &oldset);
-  len = dsi_stream_write(dsi, block, DSI_BLOCKSIZ + len);
+  len = dsi_stream_write(dsi, block, DSI_BLOCKSIZ + len, 0);
   sigprocmask(SIG_SETMASK, &oldset, NULL);
 
   return len;