summaryrefslogtreecommitdiffstats
path: root/daemon/zero.c
diff options
context:
space:
mode:
authorRichard Jones <rjones@redhat.com>2010-08-28 14:29:07 +0100
committerRichard Jones <rjones@redhat.com>2010-09-01 10:00:37 +0100
commit88ab203e611694bc0d01aca745e8df18cb3f094e (patch)
tree4934ec733d6ffffa9b8df6582cdd8e2c522f9cc3 /daemon/zero.c
parent55938405ccd3d5e5736f30c9bd78a51998cd7158 (diff)
downloadlibguestfs-88ab203e611694bc0d01aca745e8df18cb3f094e.tar.gz
libguestfs-88ab203e611694bc0d01aca745e8df18cb3f094e.tar.xz
libguestfs-88ab203e611694bc0d01aca745e8df18cb3f094e.zip
Add progress messages to zero command.
Diffstat (limited to 'daemon/zero.c')
-rw-r--r--daemon/zero.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/daemon/zero.c b/daemon/zero.c
index df4ebd64..43089e0b 100644
--- a/daemon/zero.c
+++ b/daemon/zero.c
@@ -42,12 +42,14 @@ do_zero (const char *device)
memset (buf, 0, sizeof buf);
- for (i = 0; i < 32; ++i)
+ for (i = 0; i < 32; ++i) {
if (write (fd, buf, sizeof buf) != sizeof buf) {
reply_with_perror ("write: %s", device);
close (fd);
return -1;
}
+ notify_progress ((uint64_t) i, 32);
+ }
if (close (fd) == -1) {
reply_with_perror ("close: %s", device);