blob: 2e56fa8ff06077c0bb85c0621d74ced10e30942b [file] [log] [blame]
"Robert P. J. Day"63fc1a92006-07-02 19:47:05 +00001/* vi: set sw=4 ts=4: */
Glenn L McGrath237ae422002-11-03 14:05:15 +00002/*
Denys Vlasenko0ef64bd2010-08-16 20:14:46 +02003 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
Glenn L McGrath237ae422002-11-03 14:05:15 +00004 */
5
Glenn L McGrath7ca04f32002-09-25 02:47:48 +00006#include "libbb.h"
Denys Vlasenko833d4e72010-11-03 02:38:31 +01007#include "archive.h"
Glenn L McGrath7ca04f32002-09-25 02:47:48 +00008
Denis Vlasenkodefc1ea2008-06-27 02:52:20 +00009void FAST_FUNC data_align(archive_handle_t *archive_handle, unsigned boundary)
Glenn L McGrath7ca04f32002-09-25 02:47:48 +000010{
Denis Vlasenko284d0fa2008-02-16 13:18:17 +000011 unsigned skip_amount = (boundary - (archive_handle->offset % boundary)) % boundary;
Glenn L McGrath7ca04f32002-09-25 02:47:48 +000012
Denys Vlasenko0a130d52009-08-28 21:09:51 +020013 archive_handle->seek(archive_handle->src_fd, skip_amount);
Glenn L McGrath237ae422002-11-03 14:05:15 +000014 archive_handle->offset += skip_amount;
Glenn L McGrath7ca04f32002-09-25 02:47:48 +000015}