diff rvinterf/etmsync/pirmagnetite.c @ 306:8136fb5eb292

fc-fsio: write_buf_to_file() function made global in prep for upload-rf-table
author Mychaela Falconia <falcon@freecalypso.org>
date Tue, 21 Nov 2017 06:09:35 +0000
parents a3763707317f
children
line wrap: on
line diff
--- a/rvinterf/etmsync/pirmagnetite.c	Mon Nov 20 17:51:23 2017 +0000
+++ b/rvinterf/etmsync/pirmagnetite.c	Tue Nov 21 06:09:35 2017 +0000
@@ -56,33 +56,6 @@
 }
 
 static
-write_buf_to_file(pathname, data, datalen)
-	char *pathname;
-	u_char *data;
-{
-	int tfd, rc, chunk, remain;
-
-	if (datalen <= max_short_file_write(pathname))
-		return do_short_fwrite(pathname, data, datalen);
-	/* do it the long way */
-	rc = fd_open(pathname, FFS_O_WRONLY | FFS_O_CREATE | FFS_O_TRUNC, &tfd);
-	if (rc)
-		return(rc);
-	for (remain = datalen; remain; remain -= chunk) {
-		chunk = remain;
-		if (chunk > 240)
-			chunk = 240;
-		rc = fd_write(tfd, data, chunk);
-		if (rc) {
-			fd_close(tfd);
-			return(rc);
-		}
-		data += chunk;
-	}
-	return fd_close(tfd);
-}
-
-static
 copy_calib_record(memaddr, pathname, size)
 	u32 memaddr;
 	char *pathname;