/*
- * $Id: dsi_write.c,v 1.3 2001-06-29 14:14:46 rufustfirefly Exp $
+ * $Id: dsi_write.c,v 1.5 2009-10-20 04:31:41 didg Exp $
*
* Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu)
* All rights reserved. See COPYRIGHT.
/* this streams writes */
#include <stdio.h>
-#ifdef HAVE_UNISTD_H
#include <unistd.h>
-#endif /* HAVE_UNISTD_H */
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/time.h>
-#ifdef HAVE_FCNTL_H
#include <fcntl.h>
-#endif /* HAVE_FCNTL_H */
#include <string.h>
#include <atalk/dsi.h>
-#include <netatalk/endian.h>
#ifndef MIN
#define MIN(a,b) ((a) < (b) ? (a) : (b))
/* initialize relevant things for dsi_write. this returns the amount
* of data in the data buffer. the interface has been reworked to allow
* for arbitrary buffers. */
-size_t dsi_writeinit(DSI *dsi, void *buf, const size_t buflen)
+size_t dsi_writeinit(DSI *dsi, void *buf, const size_t buflen _U_)
{
- const struct itimerval none = {{0, 0}, {0, 0}};
size_t len, header;
/* figure out how much data we have. do a couple checks for 0
} else
len = 0;
- /* deal with signals. i'm doing it this way to ensure that we don't
- * get confused if a writeflush on zero remaining data is, for some
- * reason, needed. */
- sigprocmask(SIG_BLOCK, &dsi->sigblockset, NULL);
- setitimer(ITIMER_REAL, &none, &dsi->savetimer);
return len;
}
dsi->datasize -= length;
return length;
}
-
- setitimer(ITIMER_REAL, &dsi->savetimer, NULL);
- sigprocmask(SIG_UNBLOCK, &dsi->sigblockset, NULL);
return 0;
}
else
break;
}
-
- setitimer(ITIMER_REAL, &dsi->savetimer, NULL);
- sigprocmask(SIG_UNBLOCK, &dsi->sigblockset, NULL);
}