mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-21 22:53:37 +00:00
upload: improve file write callback
As noted by Pino in another patch, the logic passes the first member of the struct which happens to be the right address to the callback function. This will break the callback if order of the members of the struct will change. As the callback is using the entire struct, better to pass the pointer to the struct itself. Signed-off-by: Matteo Cafasso <noxdafox@gmail.com>
This commit is contained in:
committed by
Richard W.M. Jones
parent
4152388530
commit
5d36f5ae82
@@ -84,7 +84,7 @@ upload (const char *filename, int flags, int64_t offset)
|
||||
}
|
||||
}
|
||||
|
||||
r = receive_file (write_cb, &data.fd);
|
||||
r = receive_file (write_cb, &data);
|
||||
if (r == -1) { /* write error */
|
||||
err = errno;
|
||||
r = cancel_receive ();
|
||||
|
||||
Reference in New Issue
Block a user