Module Name:    othersrc
Committed By:   agc
Date:           Fri Feb 17 02:06:54 UTC 2012

Modified Files:
        othersrc/external/bsd/httpdev/dist: main.c

Log Message:
return the number of characters read/written in the small target operation,
not the size that was requested.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 othersrc/external/bsd/httpdev/dist/main.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: othersrc/external/bsd/httpdev/dist/main.c
diff -u othersrc/external/bsd/httpdev/dist/main.c:1.3 othersrc/external/bsd/httpdev/dist/main.c:1.4
--- othersrc/external/bsd/httpdev/dist/main.c:1.3	Thu Feb 16 04:06:57 2012
+++ othersrc/external/bsd/httpdev/dist/main.c	Fri Feb 17 02:06:54 2012
@@ -125,7 +125,7 @@ inquiry(const char *uri, targetinfo_t *i
 }
 
 /* read info from the target - method depends on size of data being read */
-static int 
+static ssize_t 
 targetop(const char *uri, uint64_t offset, uint32_t length, char *buf, const int writing)
 {
 	if (writing) {
@@ -235,15 +235,16 @@ httpdev_read(const char *path, char *buf
 	virt_dirent_t	*ep;
 	smalltgt_t	*smalltgt;
 	const int	 reading = 0;
+	ssize_t		 rc;
 
 	if ((ep = virtdir_find(&httpdev, path, strlen(path))) == NULL) {
 		return -ENOENT;
 	}
 	smalltgt = (smalltgt_t *)ep->tgt;
-	if (targetop(smalltgt->uri, offset, size, buf, reading) < 0) {
+	if ((rc = targetop(smalltgt->uri, offset, size, buf, reading)) < 0) {
 		return -EPERM;
 	}
-	return size;
+	return rc;
 }
 
 /* write the file's contents to the file system */
@@ -254,15 +255,16 @@ httpdev_write(const char *path, const ch
 	virt_dirent_t	*ep;
         smalltgt_t	*smalltgt;
 	const int	 writing = 1;
+	ssize_t		 wc;
 
 	if ((ep = virtdir_find(&httpdev, path, strlen(path))) == NULL) {
 		return -ENOENT;
 	}
 	smalltgt = (smalltgt_t *)ep->tgt;
-	if (targetop(smalltgt->uri, offset, size, __UNCONST(buf), writing) < 0) {
+	if ((wc = targetop(smalltgt->uri, offset, size, __UNCONST(buf), writing)) < 0) {
 		return -EPERM;
 	}
-	return size;
+	return wc;
 }
 
 /* fill in the statvfs struct */

Reply via email to