Browse code

do not try to continue if there's no space on device

git-svn-id: file:///var/lib/svn/clamav-devel/trunk/clamav-devel@1337 77e5149b-7576-45b1-b177-96237e5ba77b

Tomasz Kojm authored on 2005/02/14 07:25:41
Showing 2 changed files
... ...
@@ -1,3 +1,7 @@
1
+Sun Feb 13 23:17:16 CET 2005 (tk)
2
+---------------------------------
3
+  * libclamav/untar.c: do not try to continue if there's no space on device
4
+
1 5
 Sun Feb 13 20:52:57 GMT 2005 (njh)
2 6
 ----------------------------------
3 7
   * clamav-milter:	Up-issue to 0.83
... ...
@@ -21,6 +21,9 @@
21 21
  *
22 22
  * Change History:
23 23
  * $Log: untar.c,v $
24
+ * Revision 1.20  2005/02/13 22:25:41  kojm
25
+ * do not try to continue if there's no space on device
26
+ *
24 27
  * Revision 1.19  2004/12/16 15:34:57  nigelhorne
25 28
  * Tidy
26 29
  *
... ...
@@ -79,7 +82,7 @@
79 79
  * First draft
80 80
  *
81 81
  */
82
-static	char	const	rcsid[] = "$Id: untar.c,v 1.19 2004/12/16 15:34:57 nigelhorne Exp $";
82
+static	char	const	rcsid[] = "$Id: untar.c,v 1.20 2005/02/13 22:25:41 kojm Exp $";
83 83
 
84 84
 #include <stdio.h>
85 85
 #include <errno.h>
... ...
@@ -277,8 +280,10 @@ cli_untar(const char *dir, int desc)
277 277
 			const int nwritten = fwrite(block, 1, nbytes, outfile);
278 278
 
279 279
 			if(nwritten != nbytes) {
280
-				cli_errmsg("cli_untar: only wrote %d bytes to file %s\n",
280
+				cli_errmsg("cli_untar: only wrote %d bytes to file %s (out of disk space?)\n",
281 281
 					nwritten, fullname);
282
+				fclose(outfile);
283
+				return CL_EIO;
282 284
 			}
283 285
 			size -= nbytes;
284 286
 		}